I have a few rails apps that I have on a single VPS. I am using nginx, passenger, mysql and rails 4 for all of them. Two of the apps are working fine in the production ENV, but one of my apps is not switching to production. It just stays in development. I use mina for deployment. I've been pulling my hair out over this trying to figure out the reason why.
In my /etc/nginx/nginx.conf
I have
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.in$
passenger_ruby /home/ME/.rbenv/shims/ruby;
passenger_app_env production;
and my server blocks for each of my apps are identical like this (replacing "mysite" with the respective app names)
server {
listen 80;
# listen [::]:80 ipv6only=on;
server_name mysite.com www.mysite.com;
passenger_enabled on;
passenger_friendly_error_pages on;
rails_env production;
root /var/www/mysite.com/current/public;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Can anyone help? I don't think Ive changed anything in the apps code, but can anyone think of something that I may have altered? Are there any rails files I could have changed that would be causing this? Thanks.
Update 7/13/14
So i've completely removed the files from my app on the server and re deployed fresh, and Im still having the problem. I am using mina to deploy my apps, and I ran mina deploy --trace
and it says its doing $ RAILS_ENV="production" bundle exec rake assets:precompile RAILS_GROUPS=assets
. I also added a test to my footer (Rails.env.production?
) and it is returning false. Thanks for any help.
Update 7/14/14
So to test if it was my server or my code, I ran rails server -e production
on my development machine. I still have the same problem with the Rails.env.production?
returning false. So its clearly something in my rails code. Ihave no clue what I could have altered though still.