Rails console default environment

吃可爱长大的小学妹 提交于 2019-11-30 08:35:18

The rails executable can't know which environment should run on which machine.

you can put export RAILS_ENV=production in your ~/.bashrc or ~/.bash_profile file of the user you want to start the console with.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!