无法从Hartl的Ruby on Rails教程第7章运行Heroku应用程序

时间:2017-04-17 18:35:37

标签: ruby-on-rails ruby heroku

已经多次询问过,但到目前为止,之前的解决方案对我来说并不适用。

我是初学者,我正在尝试学习Rails而我正在跟随famous tutorial from Hartl,我在第7章 到目前为止我的项目的This is the Github pagethis is the Heroku app

Heroku网站说:

  

申请错误
  应用程序中发生错误,无法提供您的页面。如果您是应用程序所有者,请检查日志以获取详细信息。

$ heroku logs说:

app[api]: Initial release by user my.email@address.com
app[api]: Release v1 created by user my.email@address.com
app[api]: Release v2 created by user my.email@address.com
app[api]: Enable Logplex by user my.email@address.com
app[api]: Release v2 created by user my.email@address.com
app[api]: Starting process with command "rake db:migrate" by user my.email@address.com 
heroku[run.5962]: Awaiting client
heroku[run.5962]: State changed from starting to up
heroku[run.5962]: Starting process with command "rake db:migrate"
heroku[run.5962]: Process exited with status 127
heroku[run.5962]: State changed from up to complete
app[api]: Starting process with command "rails db:migrate" by user my.email@address.com 
heroku[run.3462]: State changed from starting to up
heroku[run.3462]: Awaiting client
heroku[run.3462]: Starting process with command "rails db:migrate"
heroku[run.3462]: State changed from up to complete
heroku[run.3462]: Process exited with status 127
app[api]: Build started by user my.email@address.com
app[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by user my.email@address.com 
app[api]: Release v3 created by user my.email@address.com
app[api]: Release v3 created by user my.email@address.com
app[api]: Release v4 created by user my.email@address.com
app[api]: Release v4 created by user my.email@address.com
app[api]: Attach DATABASE (@ref:postgresql-clear-76865) by user my.email@address.com
app[api]: Deploy ec2b24d by user my.email@address.com
app[api]: Scaled to console@0:Free rake@0:Free web@1:Free worker@0:Free by user my.email@address.com 
app[api]: Release v5 created by user my.email@address.com
app[api]: Release v5 created by user my.email@address.com
app[api]: Build succeeded
heroku[web.1]: Starting process with command "bundle exec pume -C config/puma.rb" 
app[web.1]: bundler: command not found: pume
app[web.1]: Install missing gem executables with "bundle install"
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Process exited with status 127
heroku[web.1]: Starting process with command "bundle exec pume -C config/puma.rb" 
app[web.1]: bundler: command not found: pume
app[web.1]: Install missing gem executables with "bundle install"
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed
app[api]: Starting process with command "bundle exec rake db:migrate" by user my.email@address.com  
heroku[run.7856]: Awaiting client
heroku[run.7856]: Starting process with command "bundle exec rake db:migrate"  
heroku[run.7856]: State changed from starting to up
heroku[run.7856]: Process exited with status 0
heroku[run.7856]: State changed from up to complete
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=infinite-thicket-26445.herokuapp.com request_id=c026b5fa-c5fd-49da-8117-8a237a54926a fwd="83.42.129.78" dyno= connect= service= status=503
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=infinite-thicket-26445.herokuapp.com request_id=b7fc3150-d64f-4496-b2c9-0e010eeed3b9 fwd="83.42.129.78" dyno= connect= service= status=503
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=infinite-thicket-26445.herokuapp.com request_id=8ed0ddde-7128-4efb-bf31-670c32129e8c fwd="83.42.129.78" dyno= connect= service= status=503
  • 我尝试过迁移($ heroku run rails db:migrate$ heroku run rake db:migrate

  • 我尝试重新启动Heroku dyno($ heroku restart

  • 该应用程序在本地工作非常出色(在:development上)并且书中的所有测试都是绿色的。

  • $ heroku ps的输出:
    === web (Free): bundle exec pume -C config/puma.rb (1) web.1: crashed 2017/04/17 16:21:13 +0200 (~ 2h ago)

  • $ bundle update已多次运行,并删除Gemfile.lock以重新重建

  • .Procfile,正如教程中所建议的:
    web: bundle exec puma -C config/puma.rb

,这很奇怪:

  • $ heroku logs中我注意到了这一点:
    heroku[web.1]: Starting process with command bundle exec pume -C config/puma.rb
    app[web.1]: bundler: command not found: pume

为什么pume?在.Procfile它没有说出来!

edit2:开始工作后,我重命名了应用程序。现在是https://manuel-sample-app.herokuapp.com/

1 个答案:

答案 0 :(得分:0)

好的,那太傻了..

原来,教程说

  

应该在应用程序的根目录中创建Procfile

     

代码清单7.38:为Puma定义一个Procfile   ./Procfile
  web: bundle exec puma -C config/puma.rb

并且我把它与./.Procfile混淆了,所以我真正的Procfile有一个错字但是我正在修复一个无用的隐藏文件,其名称相同,认为它是正确的 抱歉,今天太累了,我的眼睛正在相互交叉