nginx 上的乘客没有在 rails 上重新加载我的更改 ruby
Passenger on nginx is not reloading my changes ruby on rails
我的一个模型中有这个查询 (round.rb)
每当创建一个回合时,我想自动生成属于该回合的所有匹配项。
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
我希望看到类似的内容:
Match Create (0.8ms) INSERT INTO "matches" ("home_player_user_id", "away_player_user_id", "round_id", "created_at", "updated_at", "first_pokemon", "second_pokemon", "third_pokemon") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["home_player_user_id", 1], ["away_player_user_id", 1], ["round_id", 1], ["created_at", "2018-11-25 10:08:14.422748"], ["updated_at", "2018-11-25 10:08:14.422748"], ["first_pokemon", 2], ["second_pokemon", 2], ["third_pokemon", 3]]
在日志中。
但是,我看到只有部分 INSERT 查询被使用,例如:
D, [2018-11-25T09:45:03.240848 #4994] DEBUG -- : Match Create (0.3ms) INSERT INTO "matches" ("away_player_user_id", "round_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["away_player_user_id", 1], ["round_id", 20], ["created_at", "2018-11-25 08:45:03.239943"], ["updated_at", "2018-11-25 08:45:03.239943"]]
在这个例子中 home_player_user_id 是 nil
这完全没问题,但是我没有看到设置任何其他字段,例如 first_pokemon
、second_pokemon
等等在数据库中,这打破了我的整个逻辑。
这只发生在使用 passenger 的 nginx 服务器 (https) 上。
我会在每次部署时重新启动乘客应用程序,因此我应该掌握所有最新的更改。
在我的本地机器上,它在生产和开发中(使用 rails s
)完全正常工作
有人知道我在这里可能遗漏了什么吗?
非常感谢您!
问题确实是 passenger 和 nginx 没有反映这些变化。我完全重新启动了服务器计算机,然后它获取了更改
我的一个模型中有这个查询 (round.rb) 每当创建一个回合时,我想自动生成属于该回合的所有匹配项。
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
我希望看到类似的内容:
Match Create (0.8ms) INSERT INTO "matches" ("home_player_user_id", "away_player_user_id", "round_id", "created_at", "updated_at", "first_pokemon", "second_pokemon", "third_pokemon") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["home_player_user_id", 1], ["away_player_user_id", 1], ["round_id", 1], ["created_at", "2018-11-25 10:08:14.422748"], ["updated_at", "2018-11-25 10:08:14.422748"], ["first_pokemon", 2], ["second_pokemon", 2], ["third_pokemon", 3]]
在日志中。
但是,我看到只有部分 INSERT 查询被使用,例如:
D, [2018-11-25T09:45:03.240848 #4994] DEBUG -- : Match Create (0.3ms) INSERT INTO "matches" ("away_player_user_id", "round_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["away_player_user_id", 1], ["round_id", 20], ["created_at", "2018-11-25 08:45:03.239943"], ["updated_at", "2018-11-25 08:45:03.239943"]]
在这个例子中 home_player_user_id 是 nil
这完全没问题,但是我没有看到设置任何其他字段,例如 first_pokemon
、second_pokemon
等等在数据库中,这打破了我的整个逻辑。
这只发生在使用 passenger 的 nginx 服务器 (https) 上。
我会在每次部署时重新启动乘客应用程序,因此我应该掌握所有最新的更改。
在我的本地机器上,它在生产和开发中(使用 rails s
)完全正常工作
有人知道我在这里可能遗漏了什么吗?
非常感谢您!
问题确实是 passenger 和 nginx 没有反映这些变化。我完全重新启动了服务器计算机,然后它获取了更改