我对Heroku很新。Heroku导轨Procfile
我上传了我的Rails应用程序,以Heroku的,并愿与薄,而不是使用WEBrick运行它。按照Heroku’s guide我应该使用web: bundle exec rails server thin -p $PORT -e $RACK_ENV
来创建proc文件。不过,我总是得到回复web:: command not found
。
我错过了什么?
我对Heroku很新。Heroku导轨Procfile
我上传了我的Rails应用程序,以Heroku的,并愿与薄,而不是使用WEBrick运行它。按照Heroku’s guide我应该使用web: bundle exec rails server thin -p $PORT -e $RACK_ENV
来创建proc文件。不过,我总是得到回复web:: command not found
。
我错过了什么?
你不应该运行web: bundle exec rails server thin -p $PORT -e $RACK_ENV
的命令,而是创建一个名为Procfile
与作为其内容的新文件。
无论是创建该文件并将其粘贴到使用编辑器,或只是做:
echo "web: bundle exec rails server thin -p \$PORT -e \$RACK_ENV" > Procfile
您值得拍手。 不要在那里指定你不应该运行“web:bundle exec rails server thin -p $ PORT -e $ RACK_ENV”的状态。 感谢 – RedRory 2012-05-05 22:04:22
@RedRory也许如此...但该指南中,“Procfile”这个词被链接到这个[页码](https://devcenter.heroku.com/articles/procfile)展示了如何设置一个适当的Procfile为heroku。 – courtsimas 2012-05-23 14:03:49
从你应该创建Procfile的文档中,还是很不清楚。在根目录中?从文档中不会立即明白。我猜测它被埋在那里,但为什么不让它变得更明显,只需说:“在你的shell中运行以下命令:...” – 2012-07-30 01:54:45
您是否将瘦身包装到您的应用程序中?
gem 'thin'
如果不是,您正在寻找Rails试图使用默认服务器。就我个人而言,我会考虑在Heroku上使用独角兽,但要小心你可能需要多少工人。
http://neilmiddleton.com/the-procfile-is-your-friend。缓存版本:https://web.archive.org/web/20130926005616/http://www.neilmiddleton.com/the-procfile-is-your-friend
http://neilmiddleton.com/getting-more-from-your-heroku-dynos
你加薄宝石到你的Gemfile?其实我认为你甚至需要创建Procfile,如果你只是在瘦服务器上运行它。要以精简方式运行,只需在gemfile上运行即可。你真的需要一个配置文件,如果你的应用有更多的进程 – 2012-04-19 21:41:03
我有。它的奇怪虽然我不能使用上面的语法创建一个procfile。它jsut总是说网络:命令未找到 – 2012-04-19 21:47:32
您是否尝试过安装本地工头('gem install foreman')并尝试运行您的应用程序以模仿Heroku上发生的事情? – 2012-04-19 21:56:51