Ruby-on-rails Heroku rails Procfile

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10237200/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 03:15:32  来源:igfitidea点击:

Heroku rails Procfile

ruby-on-railsheroku

提问by Hans Adiputra Arijanto

I am very new to Heroku.

我对 Heroku 很陌生。

I uploaded my Rails app to Heroku and would like to run it with Thin instead of Webrick. Following Heroku's guideI am supposed to use web: bundle exec rails server thin -p $PORT -e $RACK_ENVto create the procfile. However I always get the response web:: command not found.

我将我的 Rails 应用程序上传到 Heroku,并希望使用 Thin 而不是 Webrick 来运行它。按照Heroku 的指南,我应该web: bundle exec rails server thin -p $PORT -e $RACK_ENV用来创建 procfile。但是我总是得到回应web:: command not found

What am I missing?

我错过了什么?

回答by matt

You're not supposed to run web: bundle exec rails server thin -p $PORT -e $RACK_ENVas a command, rather you create a new file called Procfilewith that as its contents.

您不应该web: bundle exec rails server thin -p $PORT -e $RACK_ENV作为命令运行,而是创建一个新文件Procfile,将其作为其内容调用。

Either create the file and paste it in using your editor, or just do:

创建文件并使用您的编辑器将其粘贴,或者只需执行以下操作:

echo "web: bundle exec rails server thin -p $PORT -e $RACK_ENV" > Procfile

回答by Neil Middleton

Have you bundled thin into your application?

您是否已将瘦捆绑到您的应用程序中?

gem 'thin'

If not, you're looking at Rails trying to use the default server. Personally, I would look at using Unicorn on Heroku, but be careful with how many workers you might need.

如果没有,您正在查看尝试使用默认服务器的 Rails。就个人而言,我会考虑在 Heroku 上使用 Unicorn,但要注意可能需要多少工人。

http://neilmiddleton.com/the-procfile-is-your-friend. Cached version: https://web.archive.org/web/20130926005616/http://www.neilmiddleton.com/the-procfile-is-your-friend

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

http://neilmiddleton.com/getting-more-from-your-heroku-dynos