Red Hat Bugzilla – Bug 1024612
No Rails environment set during deployment
Last modified: 2015-05-14 19:32:03 EDT
Description of problem: There is no rails environment set during deployment
How reproducible: Always
Steps to Reproduce:
1. Have Rails App
2. Deploy to OpenShift
- rake assets:precompile is run without RAILS_ENV=production
- gems in development group are installed
- rake assets:precompile should be run with RAILS_ENV=production
- gems in development group should not be installed
You are mentioning install and rake assets:precompile which are two separate steps. bundle doesn't take into account RAILS_ENV at all as bundler has no knowledge of rails. And bundle is the step that installs the gems. We also run bundle install --deployment which installs exactly what you have in your Gemfile.lock.
As for the precompile, the actual step that runs is:
remote: Precompiling with 'bundle exec rake assets:precompile'
remote: /opt/rh/ruby193/root/usr/bin/ruby /var/lib/openshift/527120026650709e8c000027/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
which does include RAILS_ENV=production.
I am closing this as NOTABUG but if you have a related concern/issue please feel free to reopen.