0

I put "RAILS_ENV=production" rake about doesn't shows up production info.

deployer@proj:/var/www/proj# RAILS_ENV=production rake about
About your application's environment
Rails version             4.2.0
Ruby version              2.2.1-p85 (x86_64-linux)
RubyGems version          2.4.6
Rack version              1.6.1
JavaScript Runtime        Node.js (V8)
Middleware                Rack::Sendfile, Rack::Loc.......
Application root          /var/www/proj
Environment               development
Database adapter          mysql2
Database schema version   20150615041442

I even try: export RAILS_ENV=production RAILS_ENV=production bundle exec rake db:create bundle exec rake db:create RAILS_ENV=production

user3344010
  • 31
  • 1
  • 6

2 Answers2

0

have checked in rails console like this....

Loading development environment (Rails 4.2.1)

try this

ENV['RAILS_ENV'] ||= 'production' in environment.rb

sudo bundle exec rake db:migrate RAILS_ENV=production

sudo bundle exec rake assets:precompile RAILS_ENV=production

this may help you robmclarty.com

stackoverflow.com/a/27434582/3248148

Community
  • 1
  • 1
praaveen V R
  • 1,259
  • 1
  • 11
  • 20
0

You could set the environment using bin/rails db:environment:set RAILS_ENV=production and then run your rake tasks.

Surya
  • 2,429
  • 1
  • 21
  • 42