我在heroku (cedar-stack)上运行rails控制台时遇到了问题。以下每个命令heroku run console、heroku run rails console、heroku run bundle exec rails console都会导致以下错误消息:
正在运行附加到终端的bundle exec rails console
...启动,运行。8155
中止测试:您的Rails环境正在以生产模式运行!
这个错误消息有点混乱。什么类型的测试尝试heroku开始?我只想启动控制台,它在4周前还工作得很好。
发布于 2013-05-10 08:14:35
对于Cedar Stack和更高版本:
heroku run rails console --app <app name>
以前的堆栈可以使用以下命令:
heroku run console --app <app name>
发布于 2013-08-23 23:35:04
如果您有多个环境(暂存/生产等),则需要以下命令:
heroku run -a app-name console
如果您只有一个环境,并且从不设置暂存或其他环境,则可以只运行:
heroku run console
https://github.com/nemrow/rails_app_cheatsheet/blob/master/heroku.rdoc
发布于 2013-05-10 17:45:23
出于某些原因,您需要在Procfile
中显式定义控制台进程
# Procfile
web: script/rails server -p $PORT
console: script/rails console
这篇博文有更多细节:http://platypus.belighted.com/blog/2013/01/21/ruby-2-rails-4-heroku/
https://stackoverflow.com/questions/16472981
复制相似问题