Heroku不识别'spring'宝石,即使它被列在Gemfile中 [英] Heroku doesn't recognize 'spring' gem, even though it's listed in the Gemfile

查看:108
本文介绍了Heroku不识别'spring'宝石,即使它被列在Gemfile中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去我部署到Heroku的问题很少。今天,我创建了一个非常基本的应用程序(字面上只是带有更新的gemfile的默认新),并将其推送到Heroku。

然而,Heroku并不认识'spring'宝石,尽管它被列在Gemfile中。这导致我的应用程序崩溃。在它被问到之前,是的,我已经在更新Gemfile后运行 bundle install bundle update



Gemfile(从RoR教程中直接复制粘贴):

  source'https:/ /rubygems.org'

gem'rails','4.2.2'
gem'sass-rails','5.0.2'
gem'uglifier','2.5 .3'
gem'coffee-rails','4.1.0'
gem'jquery-rails','4.0.3'
gem'turbolinks','2.3.0'
gem'jbuilder','2.2.3'
gem'sdoc','0.4.0',group::doc

group:development,:test do
gem'sqlite3','1.3.9'
gem'byebug','3.4.0'
gem'web-console','2.0.0.beta3'
gem'spring ','1.1.3'
end

group:test do
gem'minitest-reporter','1.0.5'
gem'mini_backtrace',' 0.1.3'
gem'guard-minitest','2.3.1'
end

group:production do
gem'pg','0.17.1'
gem'rails_12factor','0.0.2'
end

运行 heroku run rails console

 在pure-falls-2221上运行rails控制台...运行6936 
/ app / vendor /ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in`to_specs':在59个宝石中找不到'spring'(= 1.1.3)(宝石: :LoadError)$ / b / b /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:307:in`to_spec'
from / app / vendor / ruby -2.0.0 / lib / ruby​​ / 2.0.0 / ruby​​gems / core_ext / kernel_gem.rb:47:在`gem'
从/ app / bin / spring:12:在< top(required)> ;'
from / app / bin / rails:4:in`load'
from / app / bin / rails:4:in< main>'

Heroku日志:

  2015-11 -17T02:00:32.426615 + 00:00 heroku [slug-compiler]:弹头编译开始
2 015-11-17T02:00:32.426624 + 00:00 heroku [slug-compiler]:弹头编译完成
2015-11-17T02:00:35.179885 + 00:00 heroku [web.1]:启动过程命令`bin / rails server -p 29889 -e production`
2015-11-17T02:00:37.945522 + 00:00 app [web.1]:从/app/vendor/ruby-2.0.0/lib /ruby/2.0.0/rubygems/dependency.rb:307:in`to_spec'
2015-11-17T02:00:37.945526 + 00:00 app [web.1]:from bin / rails:4:在< main>'
2015-11-17T02:00:37.945524 + 00:00 app [web.1]:from / app / bin / spring:12:in< top(required)> ;'
2015-11-17T02:00:37.945525 + 00:00 app [web.1]:from bin / rails:4:in`load'
2015-11-17T02:00:37.945523 +00:00应用[web.1]:从/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in`gem'
2015 -11-17T02:00:37.945512 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in`to_specs' :在59种宝石中找不到'spring'(= 1.1.3)(Gem :: LoadError)
2015-11-17T02:00:38.7 82080 + 00:00 heroku [web.1]:进程退出状态1
2015-11-17T02:00:40.980407 + 00:00 heroku [web.1]:使用命令`bin / rails server启动进程-p 7751 -e production`
2015-11-17T02:00:38.801178 + 00:00 heroku [web.1]:状态从开始变为崩溃
2015-11-17T02:00:38.801178 +00:00 heroku [web.1]:状态从崩溃改为开始
2015-11-17T02:00:43.123615 + 00:00 app [web.1]:/app/vendor/ruby-2.0。 0 / lib / ruby​​ / 2.0.0 / ruby​​gems / dependency.rb:296:in`to_specs':在59个gem(s)(Gem :: LoadError)$ b中找不到'spring'(= 1.1.3) $ b 2015-11-17T02:00:43.123626 + 00:00 app [web.1]:from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:307: in`to_spec'
2015-11-17T02:00:43.123629 + 00:00 app [web.1]:from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/ core_ext / kernel_gem.rb:47:在`gem'
2015-11-17T02:00:43.123630 + 00:00 app [web.1]:from / app / bin / spring:12:in<<顶部(必填)>'
2015-11-17T02:00:43.123630 + 00:00 ap p [web.1]:从bin / rails:4:在`load'
2015-11-17T02:00:43.123631 + 00:00 app [web.1]:from bin / rails:4:in '< main>'
2015-11-17T02:00:44.203452 + 00:00 heroku [web.1]:从开始状态变为崩溃状态
2015-11-17T02:01:05.291898+ 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path =/host = pure-falls-2221.herokuapp.com request_id = adc1ccb9-cd90-45fd-b179-ef680f936c2f fwd =125.140.58.57dyno = connect = service = status = 503 bytes =
2015-11-17T02:01:06.107852 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path =/ favicon.icohost = pure-falls-2221.herokuapp.com request_id = a92abeed-9b09-4ff8-b535-bac178eb454b fwd =125.140.58.57dyno = connect = service = status = 503字节=
2015-11-17T02:01:19.376119 + 00:00 heroku [api]:用命令`rails console`启动chrabyrd@gmail.com
2015-11-17T02:01 :21.779621 + 00:00 heroku [run.6936]:等待客户
2015-11-17T02:01:21.797009 + 00:00 heroku [run.6936]:Starti
2015-11-17T02:01:22.153107 + 00:00 heroku [run.6936]:状态从开始变为
2015-11-17T02:01: 24.185437 + 00:00 heroku [run.6936]:从状态变为完成
2015-11-17T02:01:24.169704 + 00:00 heroku [run.6936]:进程退出状态1 $ b $


解决方案

您在开发组中拥有宝石。如果你将它从该组中取出并放入主组中,则执行另一个 bundle install ,将其添加到回购并重新部署,我认为它将一切正常。


I've deployed to Heroku in the past with very few issues. Today I created a very basic app (literally just the default 'new' with an updated gemfile) and pushed it up to Heroku.

However, Heroku doesn't recognize the 'spring' gem, even though it's listed in the Gemfile. It's causing my app to crash. And before it's asked, yes I have run bundle install and bundle update after updating the Gemfile.

Gemfile (Literally copy-pasted from RoR Tutorial):

source 'https://rubygems.org'

gem 'rails',        '4.2.2'
gem 'sass-rails',   '5.0.2'
gem 'uglifier',     '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks',   '2.3.0'
gem 'jbuilder',     '2.2.3'
gem 'sdoc',         '0.4.0', group: :doc

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
end

Error message after running heroku run rails console:

Running rails console on pure-falls-2221... up, run.6936
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'spring' (= 1.1.3) among 59 total gem(s) (Gem::LoadError)
    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /app/bin/spring:12:in `<top (required)>'
    from /app/bin/rails:4:in `load'
    from /app/bin/rails:4:in `<main>'

Heroku Logs:

2015-11-17T02:00:32.426615+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-17T02:00:32.426624+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-17T02:00:35.179885+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 29889 -e production`
2015-11-17T02:00:37.945522+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
2015-11-17T02:00:37.945526+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2015-11-17T02:00:37.945524+00:00 app[web.1]:    from /app/bin/spring:12:in `<top (required)>'
2015-11-17T02:00:37.945525+00:00 app[web.1]:    from bin/rails:4:in `load'
2015-11-17T02:00:37.945523+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
2015-11-17T02:00:37.945512+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'spring' (= 1.1.3) among 59 total gem(s) (Gem::LoadError)
2015-11-17T02:00:38.782080+00:00 heroku[web.1]: Process exited with status 1
2015-11-17T02:00:40.980407+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 7751 -e production`
2015-11-17T02:00:38.801178+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-17T02:00:38.801178+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-17T02:00:43.123615+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'spring' (= 1.1.3) among 59 total gem(s) (Gem::LoadError)
2015-11-17T02:00:43.123626+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
2015-11-17T02:00:43.123629+00:00 app[web.1]:    from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
2015-11-17T02:00:43.123630+00:00 app[web.1]:    from /app/bin/spring:12:in `<top (required)>'
2015-11-17T02:00:43.123630+00:00 app[web.1]:    from bin/rails:4:in `load'
2015-11-17T02:00:43.123631+00:00 app[web.1]:    from bin/rails:4:in `<main>'
2015-11-17T02:00:44.203452+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-17T02:01:05.291898+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pure-falls-2221.herokuapp.com request_id=adc1ccb9-cd90-45fd-b179-ef680f936c2f fwd="125.140.58.57" dyno= connect= service= status=503 bytes=
2015-11-17T02:01:06.107852+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=pure-falls-2221.herokuapp.com request_id=a92abeed-9b09-4ff8-b535-bac178eb454b fwd="125.140.58.57" dyno= connect= service= status=503 bytes=
2015-11-17T02:01:19.376119+00:00 heroku[api]: Starting process with command `rails console` by chrabyrd@gmail.com
2015-11-17T02:01:21.779621+00:00 heroku[run.6936]: Awaiting client
2015-11-17T02:01:21.797009+00:00 heroku[run.6936]: Starting process with command `rails console`
2015-11-17T02:01:22.153107+00:00 heroku[run.6936]: State changed from starting to up
2015-11-17T02:01:24.185437+00:00 heroku[run.6936]: State changed from up to complete
2015-11-17T02:01:24.169704+00:00 heroku[run.6936]: Process exited with status 1

Any help would be greatly appreciated!

解决方案

You have the gem in the development group. If you take it out of that group and put it in the main group, do another bundle install, add that to the repo and redeploy, I presume it will all work just fine.

这篇关于Heroku不识别'spring'宝石,即使它被列在Gemfile中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆