Rails console default environment

前端 未结 2 562
醉酒成梦
醉酒成梦 2020-12-31 06:06

On my development machine:

$ bundle exec rails console
Loading development environment (Rails 3.2.3)
1.9.3p194 :001 > Rails.env
 => \"development\"
         


        
2条回答
  •  Happy的楠姐
    2020-12-31 06:22

    RAILS_ENV is a variable like any other which will always default to development

    if you like you can always open up '~/.bash_profile' on the production server and add this:

     alias sc="bundle exec rails console production"
    

    then run source ~/.bash_profile to reload that file for your terminal session and you can just call sc to load up console.

提交回复
热议问题