我正在尝试将我的Rails应用程序部署到Heroku。到目前为止我所做的就是创建rails应用程序,安装捆绑包并将其提交给bitbucket。下一步是部署到Heroku并打印hello world以确认其工作。我收到了这个错误:
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
我尝试搜索类似的错误,但我找不到任何特定于我的问题。这是heroku日志:
heroku[api]: Enable Logplex by email@gmail.com
heroku[api]: Release v2 created by email@gmail.com
heroku[api]: Set LANG, RAILS_ENV, RACK_ENV, SECRET_KEY_BASE, RAILS_SERVE_STATIC_FILES config vars by email@gmail.com
heroku[api]: Release v3 created by email@gmail.com
heroku[api]: Attach DATABASE resource by email@gmail.com
heroku[api]: Release v4 created by email@gmail.com
heroku[api]: Scale to web=1 by email@gmail.com
heroku[api]: Deploy 221c876 by email@gmail.com
heroku[api]: Release v5 created by email@gmail.com
heroku[slug-compiler]: Slug compilation started
heroku[slug-compiler]: Slug compilation finished
heroku[web.1]: Starting process with command `bin/rails server -p 16863 -e production`
app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent/compute.rb:3:in `require': cannot load such file -- net/ssh (LoadError)
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent/compute.rb:3:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent.rb:1:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent.rb:1:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog.rb:40:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog.rb:40:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
app[web.1]: from /app/config/application.rb:7:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
app[web.1]: from bin/rails:9:in `require'
app[web.1]: from bin/rails:9:in `<main>'
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `bin/rails server -p 14724 -e production`
app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent/compute.rb:3:in `require': cannot load such file -- net/ssh (LoadError)
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent/compute.rb:3:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent.rb:1:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog/joyent.rb:1:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog.rb:40:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/fog-1.23.0/lib/fog.rb:40:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
app[web.1]: from /app/config/application.rb:7:in `<top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
app[web.1]: from bin/rails:9:in `require'
app[web.1]: from bin/rails:9:in `<main>'
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=polar-mountain-3183.herokuapp.com request_id=4dbb54f0-d4f6-478a-8ef0-899d8030e160 fwd="174.113.76.61" dyno= connect= service= status=503 bytes=
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=polar-mountain-3183.herokuapp.com request_id=426832e0-0555-4d98-91d1-1ffdede05f6f fwd="174.113.76.61" dyno= connect= service= status=503 bytes=
我删除了日志的日期和时间,因此更容易阅读,而且行不够宽。我也删除了我的电子邮件/帐户,原因很明显。
答案 0 :(得分:1)
这是错误:
'require':无法加载此类文件--net / ssh(LoadError)
您似乎尝试在应用中添加某种ssh
功能?
具体来说,看起来它来自fog
宝石。
根据以下question,您应该可以将fog
或net-ssh
宝石添加到您的应用中,以使其正常运行:
#Gemfile
gem 'fog', '~> 1.36.0'
gem 'net-ssh'
在本地添加,然后推送到Heroku。
在黑暗中刺伤;如果它不起作用,我会高兴地删除答案。
答案 1 :(得分:1)
通过查看日志,似乎有fog
gem的内容会导致启动rails服务器出现问题。
正如你所说,你只想测试“Hello world”我暂时会建议你从Gemfile中remove fog gem
并在heroku上重新部署。
如果一切正常,那么以后你可以随时调试雾问题。