试图弄清楚为什么我的rails应用程序在heroku中崩溃了?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了试图弄清楚为什么我的rails应用程序在heroku中崩溃了?相关的知识,希望对你有一定的参考价值。

我是heroku的新手,试图第一次部署Rails应用程序。当我打开它时,它会崩溃。这是日志,只是想知道是否有人能理解它?

 018-02-28T03:49:38.908155+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2018-02-28T03:49:38.908156+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
2018-02-28T03:49:38.908160+00:00 app[web.1]:    from bin/rails:9:in `require'
2018-02-28T03:49:38.917703+00:00 app[web.1]: => Booting Puma
2018-02-28T03:49:38.908161+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2018-02-28T03:49:38.908153+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2018-02-28T03:49:38.917707+00:00 app[web.1]: => Rails 5.1.4 application starting in production 
2018-02-28T03:49:38.917709+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-28T03:49:38.917710+00:00 app[web.1]: Exiting
2018-02-28T03:50:00.911567+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=d5674160-7991-4e20-a8c2-9037cd14fca0 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:50:02.294872+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=5aac6d0b-2974-40ac-8fc3-fd314fcedba2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2018-02-28T03:49:38.908155+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2018-02-28T03:49:38.908156+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
2018-02-28T03:49:38.908160+00:00 app[web.1]:    from bin/rails:9:in `require'
2018-02-28T03:49:38.917703+00:00 app[web.1]: => Booting Puma
2018-02-28T03:49:38.908161+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2018-02-28T03:49:38.908153+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2018-02-28T03:49:38.917707+00:00 app[web.1]: => Rails 5.1.4 application starting in production 
2018-02-28T03:49:38.917709+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-28T03:49:38.917710+00:00 app[web.1]: Exiting
2018-02-28T03:50:00.911567+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=d5
674160-7991-4e20-a8c2-9037cd14fca0 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:50:02.294872+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=5aac6d0b-2974-40ac-8fc3-fd314fcedba2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2018-02-28T03:49:38.908155+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2018-02-28T03:49:38.908156+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
2018-02-28T03:49:38.908160+00:00 app[web.1]:    from bin/rails:9:in `require'
2018-02-28T03:49:38.917703+00:00 app[web.1]: => Booting Puma
2018-02-28T03:49:38.908161+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2018-02-28T03:49:38.908153+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2018-02-28T03:49:38.917707+00:00 app[web.1]: => Rails 5.1.4 application starting in production 
2018-02-28T03:49:38.917709+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-28T03:49:38.917710+00:00 app[web.1]: Exiting
2018-02-28T03:50:00.911567+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=d5
674160-7991-4e20-a8c2-9037cd14fca0 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:50:02.294872+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=5aac6d0b-2974-40ac-8fc3-fd314fcedba2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:46.845758+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=f695bff2-745d-4f14-af52-55b246316e7a fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:50.098411+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=b7af71af-e036-47b3-8c35-d9f841971cd2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2018-02-28T03:49:38.908160+00:00 app[web.1]:    from bin/rails:9:in `require'
2018-02-28T03:49:38.917703+00:00 app[web.1]: => Booting Puma
2018-02-28T03:49:38.908161+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2018-02-28T03:49:38.908153+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2018-02-28T03:49:38.917707+00:00 app[web.1]: => Rails 5.1.4 application starting in production 
2018-02-28T03:49:38.917709+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-28T03:49:38.917710+00:00 app[web.1]: Exiting
2018-02-28T03:50:00.911567+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=d5674160-7991-4e20-a8c2-9037cd14fca0 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:50:02.294872+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=5aac6d0b-2974-40ac-8fc3-fd314fcedba2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:46.845758+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=f695bff2-745d-4f14-af52-55b246316e7a fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:50.098411+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=b7af71af-e036-47b3-8c35-d9f841971cd2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2018-02-28T03:49:38.908160+00:00 app[web.1]:    from bin/rails:9:in `require'
2018-02-28T03:49:38.917703+00:00 app[web.1]: => Booting Puma
2018-02-28T03:49:38.908161+00:00 app[web.1]:    from bin/rails:9:in `<main>'
2018-02-28T03:49:38.908153+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2018-02-28T03:49:38.917707+00:00 app[web.1]: => Rails 5.1.4 application starting in production 
2018-02-28T03:49:38.917709+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-28T03:49:38.917710+00:00 app[web.1]: Exiting
2018-02-28T03:50:00.911567+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=d5674160-7991-4e20-a8c2-9037cd14fca0 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:50:02.294872+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=5aac6d0b-2974-40ac-8fc3-fd314fcedba2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:46.845758+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fidirect-api.herokuapp.com request_id=f695bff2-745d-4f14-af52-55b246316e7a fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
2018-02-28T03:52:50.098411+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fidirect-api.herokuapp.com request_id=b7af71af-e036-47b3-8c35-d9f841971cd2 fwd="199.116.73.196" dyno= connect= service= status=503 bytes= protocol=https
答案

你需要在本地安装postgres,因为没有postgres你无法安装pg gem。所以安装postgres后安装pg gem所以捆绑在你的Gemfile.lock做了条目。 heroku的问题是在部署到heroku之前必须在本地安装所有gem,因为heroku读取你的Gemfile.lock文件以安装依赖项。

以上是关于试图弄清楚为什么我的rails应用程序在heroku中崩溃了?的主要内容,如果未能解决你的问题,请参考以下文章

新手试图弄清楚 PHP [重复]

Rails 5,带有 Select2-rails 的简单表单

试图弄清楚如何使用字符退出 System.exit

试图弄清楚为啥 NewID 函数停止在 Oracle 上工作

试图弄清楚如何从 jquery datepicker 中删除假期

无法弄清楚为什么javascript不存储我的变量