简体   繁体   English

Heroku rails Procfile

[英]Heroku rails Procfile

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. 我将我的Rails应用程序上传到Heroku,并希望使用Thin而不是Webrick运行它。 Following Heroku's guide I am supposed to use web: bundle exec rails server thin -p $PORT -e $RACK_ENV to create the procfile. 遵循Heroku的指南我应该使用web: bundle exec rails server thin -p $PORT -e $RACK_ENV来创建proc文件。 However I always get the response web:: command not found . 但是我总是得到响应web:: command not found

What am I missing? 我错过了什么?

You're not supposed to run web: bundle exec rails server thin -p $PORT -e $RACK_ENV as a command, rather you create a new file called Procfile with 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

Have you bundled thin into your application? 你有没有在你的应用程序中捆绑?

gem 'thin'

If not, you're looking at Rails trying to use the default server. 如果没有,你正在看Rails试图使用默认服务器。 Personally, I would look at using Unicorn on Heroku, but be careful with how many workers you might need. 就个人而言,我会考虑在Heroku上使用Unicorn,但要小心你可能需要多少工人。

http://neilmiddleton.com/the-procfile-is-your-friend . 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 缓存版本: 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM