Ruby on Rails 中是否有 3 种形式可以调用生产、暂存等功能,用于 Rails 服务器、Rails 控制台和 Rake?
我所知道的形式是:
对于Rails 3.0:
对于rails服务器:
rails server -e production
对于rails控制台
rails console production
对于rake
rake db:migrate RAILS_ENV=production
是这样吗?我知道对于rails runner和rails dbconsole来说,它也是-e生产。是否还有更多表单?还有哪些使用 -e
的表单,而不是仅使用名称或需要 RAILS_ENV
的表单?
顺便说一句,为什么这么复杂?是不是为了掌握权力而加大难度,收取更高的咨询费用? (就像为什么在学校里他们教你使用简单的词语来表达想法,但在现实世界中,人们使用强硬的词语来获得权力。)
The forms I know of are:
For Rails 3.0:
for rails server:
rails server -e production
for rails console
rails console production
for rake
rake db:migrate RAILS_ENV=production
Is that it? I know for rails runner
and rails dbconsole
, it is -e production
as well. Are there more forms and what are other ones that use -e
vs just the name or needing RAILS_ENV
?
As a sidenote, why so complicated; is it to increase the difficulty so as to embrace the power and charge higher fees in consulting? (just as why in school they teach you to use simple words to get the idea across but in the real world, people use tough words to gain power.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你没有说你正在使用什么平台,但在 *nix 机器上,如果你想保持一致,总是有:
RAILS_ENV=test Rails server
或任何你喜欢的命令。
至于不一致背后的原因,我认为你不需要再进一步考虑开发人员的品味、懒惰等。
You don't say what platform you're using, but on a *nix machine, if you'd like to be consistent, there is always:
RAILS_ENV=test rails server
or whatever command you like.
As for reasons behind the inconsistencies, I don't think you need to look any further than developer taste, laziness, etc.