如何启动带有环境变量的Rails服务器? [英] How to start Rails server with environment variables set?
本文介绍了如何启动带有环境变量的Rails服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
rails server时插入它
VARIABLE =
如何让这个变量自动启动,而不必每次都自动转发?
所以我会这样做
rails s
,它将自动运行该变量。
解决方案
您有多种选择:
-
在
.bashrc
文件并重新加载。 -
使用
dotenv
宝石。
更多信息@ HTTP://www.gotealeaf.c om / blog / manage-environment-configuration-variables-in-rails
I have the following command. I insert it on starting the rails server
VARIABLE=development rails s
How do I make this variable start automatically, without having to wright it myself every time?
So I would then just do this
rails s
and it would run automatically with that variable.
解决方案
You have various options to do so:
More info @ http://www.gotealeaf.com/blog/managing-environment-configuration-variables-in-rails
这篇关于如何启动带有环境变量的Rails服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文