无法通过bundler安装gem并且heroku push被拒绝

时间:2012-10-20 06:39:12

标签: ruby heroku rubygems sinatra bundler

我已经尝试更新捆绑包并安装它,但它仍然失败。我已经查看了关于这个主题的所有内容,并没有解决问题。

的Gemfile:

source 'http://isitup.org/rubygems.org'
gem 'sinatra', '1.3.3'
gem 'thin'
gem 'warden'
gem 'bcrypt-ruby'

group :production do
  gem 'pg'
end

group :development, :test do
  gem 'sqlite3'
end

当我运行git push heroku master

时会发生这种情况
Counting objects: 14, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.11 KiB, done.
Total 11 (delta 7), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rack app detected
-----> Installing dependencies using Bundler version 1.2.1
   Running: bundle install --without development:test --path vendor/bundle --binstubs                            bin/ --deployment
   You are trying to install in deployment mode after changing
   your Gemfile. Run `bundle install` elsewhere and add the
   updated Gemfile.lock to version control.
   You have added to the Gemfile:
   * warden
   * bcrypt-ruby
   * pg
   * sqlite3
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rack app

To git@heroku.com:aqueous-wildwood-3092.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:aqueous-wildwood-3092.git'

感谢。

编辑: 使用bundle install

时出错
    Fetching gem metadata from http://isitup.org/rubygems.org/.
    Error TypeError during request to dependency API
    Fetching full source index from http://isitup.org/rubygems.org/
    Unfortunately, a fatal error has occurred. Please see the Bundler 
    troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 
    /usr/lib/ruby/1.9.1/rubygems.rb:540:in `initialize': not in gzip format         (Zlib::GzipFile::Error)
        from /usr/lib/ruby/1.9.1/rubygems.rb:540:in `new'
        from /usr/lib/ruby/1.9.1/rubygems.rb:540:in `gunzip'
        from /usr/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:239:in `fetch_path'
        from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:265:in `load_specs'
        from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:231:in `block in list'
        from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:227:in `each'
        from /usr/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:227:in `list'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/fetcher.rb:216:in `fetch_all_remote_specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/fetcher.rb:89:in `rescue in specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/fetcher.rb:72:in `specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/source.rb:234:in `block in remote_specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `each'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `remote_specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/source.rb:165:in `fetch_specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/source.rb:70:in `specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:191:in `block (2 levels) in index'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `each'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `block in index'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/index.rb:9:in `build'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:184:in `index'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:178:in `resolve'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/bin/bundle:14:in `block in <top (required)>'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
        from /var/lib/gems/1.9.1/gems/bundler-1.2.1/bin/bundle:14:in `<top (required)>'
    from /usr/local/bin/bundle:19:in `load'
    from /usr/local/bin/bundle:19:in `<main>'

3 个答案:

答案 0 :(得分:0)

您是否尝试在推送之前执行bundle install

答案 1 :(得分:0)

您的Gemfile.lock未使用您对Gemfile所做的最新更改进行更新。

首先尝试在本地计算机上运行bundle install,这将更新你的Gemfile.lock,然后尝试将代码推送到heroku

答案 2 :(得分:0)

问题是目前http://rubygems.org已关闭。查看http://status.rubygems.org/

Bundler检查那里的依赖关系,如果它无法得到答案,它将随后失败。 rubygems人正在调查这个问题。