2012-04-28 82 views
0

我遇到了將我的rails項目推回到heroku的問題。前幾天我能做到這一點。我對文件進行了一些更改,並嘗試使用git push heroku重新推送。它啓動過程,然後給我這些錯誤。Heroku推送被拒絕,未能通過Bundler安裝寶石

> Counting objects: 56, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (35/35), done. 
Writing objects: 100% (37/37), 3.96 KiB, done. 
Total 37 (delta 18), reused 0 (delta 0) 

`-----> Heroku receiving push 
-----> Ruby/Rails app detected 
-----> Detected Rails is not set to serve static_assets 
     Installing rails3_serve_static_assets... done 
-----> Configure Rails 3 to disable x-sendfile 
     Installing rails3_disable_x_sendfile... done 
-----> Configure Rails to log to stdout 
     Installing rails_log_stdout... done 
-----> Gemfile detected, running Bundler version 1.0.7 
     Unresolved dependencies detected; Installing... 
     Using --without development:test 
     Fetching source index for https://rubygems.org/ 
     Installing rake (0.9.2.2) 
     Installing ZenTest (4.7.0) /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:170:in `install': ZenTest requires RubyG 
ems version ~> 1.8. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError) 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `block in run' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>' 
     from /usr/ruby1.9.2/bin/bundle:19:in `load' 
     from /usr/ruby1.9.2/bin/bundle:19:in `<main>' 
     FAILED: http://devcenter.heroku.com/articles/bundler 
!  Heroku push rejected, failed to install gems via Bundler 

`To [email protected]:mbartonsampleapp.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:mbartonsampleapp.git' 

我的寶石費爾具有

source 'https://rubygems.org' 

gem 'rails', '3.2.3' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 


gem 'heroku' 

group :development do 
    gem "ZenTest", "~> 4.7.0" 
gem 'sqlite3' 
gem 'autotest', '4.4.6' 
gem 'rspec-rails', '2.9.0' 
end 
# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

group :production do 
# gems specifically for Heroku go here 
    gem 'pg' 

end 
group :test do 
gem 'autotest', '4.4.6' 
gem 'rspec-rails', '2.9.0' 
gem 'webrat', '0.7.3' 
gem "spork", '0.9.0' 

end 
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    gem 'therubyracer', :platform => :ruby 
    gem 'execjs' 
    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 
+0

你的'Gemfile'看起來有點混亂:'assets'沒有關閉(缺少'end'),所以你的'production'和'test'組被有效地嵌套。 (在'gem'uglifier''後面有一個額外的'end',它最終會關閉它)。 – matt 2012-04-28 19:41:23

+0

這工作!我把它清理乾淨了。感謝您的幫助.. – 2012-04-28 19:55:18

+1

太棒了!我已經提出了我的評論一個答案,所以你可以接受它,如果你想這個問題將被標記爲已回答。 – matt 2012-04-28 20:07:08

回答

0

Gemfile看起來有點搞砸了:在assets組沒有關閉(它缺少一個end),所以你productiontest組嵌套在它(在gem 'uglifier'之後還有一個額外的end,最終關閉它)。

這可能會讓Bundler混淆,因此它看不到ZenTestdevelopment組中,並嘗試將其安裝在Heroku上。

相關問題