【问题标题】:Ruby on rails Heroku deployment issueRuby on rails Heroku 部署问题
【发布时间】:2019-04-01 22:15:23
【问题描述】:

我对 ruby​​ on rails 和 heroku 完全陌生。我将我的第一个 ruby​​ on rails 应用程序部署到 heroku,当我访问网站时,它显示应用程序错误。

Heroku 日志:

2018-10-29T00:40:38.462970+00:00 heroku[web.1]: State changed from crashed to starting
2018-10-29T00:40:43.768770+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 43245 -e production`
2018-10-29T00:40:47.367294+00:00 app[web.1]: Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
2018-10-29T00:40:47.927710+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find nokogiri-1.8.5 in any of the sources (Bundler::GemNotFound)
2018-10-29T00:40:47.927736+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/spec_set.rb:81:in `map!'
2018-10-29T00:40:47.927740+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/spec_set.rb:81:in `materialize'
2018-10-29T00:40:47.927742+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/definition.rb:159:in `specs'
2018-10-29T00:40:47.927744+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/definition.rb:218:in `specs_for'
2018-10-29T00:40:47.927745+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/definition.rb:207:in `requested_specs'
2018-10-29T00:40:47.927748+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:109:in `block in definition_method'
2018-10-29T00:40:47.927750+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:21:in `setup'
2018-10-29T00:40:47.927752+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler.rb:101:in `setup'
2018-10-29T00:40:47.927753+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/setup.rb:19:in `<top (required)>'
2018-10-29T00:40:47.927756+00:00 app[web.1]: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `require'
2018-10-29T00:40:47.927758+00:00 app[web.1]: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
2018-10-29T00:40:47.927759+00:00 app[web.1]: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in `require'
2018-10-29T00:40:47.927762+00:00 app[web.1]: from /app/config/boot.rb:3:in `<top (required)>'
2018-10-29T00:40:47.927764+00:00 app[web.1]: from bin/rails:3:in `require_relative'
2018-10-29T00:40:47.927767+00:00 app[web.1]: from bin/rails:3:in `<main>'
2018-10-29T00:40:48.028594+00:00 heroku[web.1]: State changed from starting to crashed
2018-10-29T00:40:48.011732+00:00 heroku[web.1]: Process exited with status 1

【问题讨论】:

  • 我们不需要您的整个日志文件。请提供相关部分。寻求调试帮助的问题(“为什么这段代码不起作用?”)必须包括所需的行为、特定的问题或错误以及在问题本身中重现它所需的最短代码。没有明确问题陈述的问题对其他读者没有用处。请参阅:如何创建 Minimal, Complete, and Verifiable 示例
  • 好吧,我不知道我应该寻找什么。我可能会删除可能导致问题的日志部分。
  • Heroku 部署构建日志会有帮助吗?
  • 日志显示Try: gem pristine bootsnap --version 1.3.2
  • 尝试在您的本地机器上运行它并更新您的 Gemfile.lock。推送更新并部署。

标签: ruby-on-rails ruby ruby-on-rails-3 heroku rubygems


【解决方案1】:

转到您的应用所在的文件夹,然后执行以下操作:

gem pristine bootsnap --version 1.3.2
bundle install 

然后尝试再次推送到heroku

【讨论】:

    猜你喜欢
    • 2012-05-23
    • 1970-01-01
    • 1970-01-01
    • 2016-01-06
    • 2013-05-25
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多