Passenger on nginx is not reloading my changes ruby on rails
I have this query in one of my models (round.rb)
and whenever a round is created I want to generate all matches that belong to that round automatically.
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
I expect to see something like:
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]]
in the logs.
However, I see only parts of that INSERT query being used like:
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"]]
in this example home_player_user_id was nil
which is completely fine, however I don't see any other fields like first_pokemon
, second_pokemon
and so on being set in the database, which breaks my whole logic.
This only occurs on production on an nginx server (https) using passenger.
I am restarting the passenger app with every deploy and thus I should have all the latest changes at hand.
On my local machine it works completely fine in (with rails s
) in production and development
Does someone have a clue on what I could be missing here?
Thank you very much in advance!
ruby-on-rails activerecord passenger
|
show 17 more comments
I have this query in one of my models (round.rb)
and whenever a round is created I want to generate all matches that belong to that round automatically.
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
I expect to see something like:
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]]
in the logs.
However, I see only parts of that INSERT query being used like:
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"]]
in this example home_player_user_id was nil
which is completely fine, however I don't see any other fields like first_pokemon
, second_pokemon
and so on being set in the database, which breaks my whole logic.
This only occurs on production on an nginx server (https) using passenger.
I am restarting the passenger app with every deploy and thus I should have all the latest changes at hand.
On my local machine it works completely fine in (with rails s
) in production and development
Does someone have a clue on what I could be missing here?
Thank you very much in advance!
ruby-on-rails activerecord passenger
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58
|
show 17 more comments
I have this query in one of my models (round.rb)
and whenever a round is created I want to generate all matches that belong to that round automatically.
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
I expect to see something like:
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]]
in the logs.
However, I see only parts of that INSERT query being used like:
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"]]
in this example home_player_user_id was nil
which is completely fine, however I don't see any other fields like first_pokemon
, second_pokemon
and so on being set in the database, which breaks my whole logic.
This only occurs on production on an nginx server (https) using passenger.
I am restarting the passenger app with every deploy and thus I should have all the latest changes at hand.
On my local machine it works completely fine in (with rails s
) in production and development
Does someone have a clue on what I could be missing here?
Thank you very much in advance!
ruby-on-rails activerecord passenger
I have this query in one of my models (round.rb)
and whenever a round is created I want to generate all matches that belong to that round automatically.
Match.create(
home_player_user_id: home,
away_player_user_id: away,
round_id: id,
first_pokemon: 2,
second_pokemon: 2,
third_pokemon: 3)
I expect to see something like:
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]]
in the logs.
However, I see only parts of that INSERT query being used like:
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"]]
in this example home_player_user_id was nil
which is completely fine, however I don't see any other fields like first_pokemon
, second_pokemon
and so on being set in the database, which breaks my whole logic.
This only occurs on production on an nginx server (https) using passenger.
I am restarting the passenger app with every deploy and thus I should have all the latest changes at hand.
On my local machine it works completely fine in (with rails s
) in production and development
Does someone have a clue on what I could be missing here?
Thank you very much in advance!
ruby-on-rails activerecord passenger
ruby-on-rails activerecord passenger
edited Nov 25 '18 at 14:14
dhartwich
asked Nov 25 '18 at 10:12
dhartwichdhartwich
1082315
1082315
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58
|
show 17 more comments
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58
|
show 17 more comments
1 Answer
1
active
oldest
votes
The problem was indeed that passenger and nginx were not reflecting the changes. I restarted the server machine completely and then it picked up the changes
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53466490%2fpassenger-on-nginx-is-not-reloading-my-changes-ruby-on-rails%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem was indeed that passenger and nginx were not reflecting the changes. I restarted the server machine completely and then it picked up the changes
add a comment |
The problem was indeed that passenger and nginx were not reflecting the changes. I restarted the server machine completely and then it picked up the changes
add a comment |
The problem was indeed that passenger and nginx were not reflecting the changes. I restarted the server machine completely and then it picked up the changes
The problem was indeed that passenger and nginx were not reflecting the changes. I restarted the server machine completely and then it picked up the changes
answered Nov 29 '18 at 10:21
dhartwichdhartwich
1082315
1082315
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53466490%2fpassenger-on-nginx-is-not-reloading-my-changes-ruby-on-rails%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you make sure you have latest code version on server? Also you could try to restart passenger manually
– Martin Zinovsky
Nov 25 '18 at 10:36
Yea as I stated above whenever I deploy a new update I make sure to restart the passenger app so the latest version will be served, don't know if that can go wrong somewhere
– dhartwich
Nov 25 '18 at 10:44
Can you put the structure.sql for Match and the models code?
– Ana María Martínez Gómez
Nov 25 '18 at 10:47
Schema: gist.github.com/dhartwich1991/…
– dhartwich
Nov 25 '18 at 10:55
The model that creates matches: gist.github.com/dhartwich1991/c58e72780fb3d8e1af2759aaaf1dff8d
– dhartwich
Nov 25 '18 at 10:58