2011-11-23 23 views
2

我試圖推,我看到:如何推heroku高手?

[email protected]:~/work/ruby/blog3$ git push heroku master Counting 
objects: 119, done. Delta compression using up to 2 threads. 
Compressing objects: 100% (105/105), done. Writing objects: 100% 
(119/119), 31.46 KiB, done. Total 119 (delta 16), 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 http://rubygems.org/ 
     Installing rake (0.9.2.2) 
     Installing multi_json (1.0.3) 
     Installing activesupport (3.1.1) 
     Installing builder (3.0.0) 
     Installing i18n (0.6.0) 
     Installing activemodel (3.1.1) 
     Installing erubis (2.7.0) 
     Installing rack (1.3.5) 
     Installing rack-cache (1.1) 
     Installing rack-mount (0.8.3) 
     Installing rack-test (0.6.1) 
     Installing hike (1.2.1) 
     Installing tilt (1.3.3) 
     Installing sprockets (2.0.3) 
     Installing actionpack (3.1.1) 
     Installing mime-types (1.17.2) 
     Installing polyglot (0.3.3) 
     Installing treetop (1.4.10) 
     Installing mail (2.3.0) 
     Installing actionmailer (3.1.1) 
     Installing arel (2.2.1) 
     Installing tzinfo (0.3.31) 
     Installing activerecord (3.1.1) 
     Installing activeresource (3.1.1) 
     Installing coffee-script-source (1.1.3) 
     Installing execjs (1.2.9) 
     Installing coffee-script (2.2.0) 
     Installing rack-ssl (1.3.2) 
     Installing json (1.6.1) with native extensions 
     Installing rdoc (3.11) 
     Installing thor (0.14.6) 
     Installing railties (3.1.1) 
     Installing coffee-rails (3.1.1) 
     /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:519:in `normalize_yaml_input': invalid byte sequence in US-ASCII (Argumen 
tError) 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:479:in 
`from_yaml' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:183:in 
`load_gemspec' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:51:in 
`block in initialize' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:64:in 
`block in each' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in 
`loop' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in 
`each' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:32:in 
`initialize' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in 
`new' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in 
`open' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package.rb:58:in `open' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:63:in `from_io' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:51:in `block in from_file_by_path' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open' 
     from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:50:in `from_file_by_path' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:72:in `fetch' 
     from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:45: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]:furious-river-2242.git ! [remote rejected] master 
-> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:furious-river-2242.git' 

所以,of'course它看起來像this 我的Gemfile改變分貝PG +捆綁安裝,並有捆綁後,沒有失誤。但我再次看到它。 這是我的寶石文件

source 'http://rubygems.org' 

gem 'rails', '3.1.1' 

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

#gem 'sqlite3' 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.1.4' 
    gem 'coffee-rails', '~> 3.1.1' 
    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

group :production, :staging do 
    #gem "mysql2" 
    #gem 'sqlite3-ruby', :require => 'sqlite3' 
    gem "pg" 
end 

group :development, :test do 
    gem "pg" 
    #gem "sqlite3-ruby", :require => "sqlite3" 
end 

#gem 'ruby-xslt' 

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

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

# Deploy with Capistrano 
# gem 'capistrano' 

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

group :test do 
    # Pretty printed test output 
    gem 'turn', :require => false 
end 

爲什麼?

+0

你正在使用哪個堆棧?對於3.1,確保將堆棧設置爲雪松。此外,如果postgresql是您的開發RDBMS,則應該只能使用'gem「pg」',而不是將它們放在組塊中。只需取出mysql2和sqlite參考。 – agmcleod

+0

我使用rails 3.1,我試過mysql,但錯誤重複。當我嘗試安裝bundle或更新時,沒有錯誤。 heroku日誌:2011-11-24T07:46:40 + 00:00 heroku [slugc]:S comp編譯失敗:未能通過Bundler安裝gems – user1028432

+0

猜測,我認爲嘗試安裝咖啡欄時失敗。你可以嘗試單獨安裝嗎? 'gem install coffee-rails' – agmcleod

回答

1

可以更改PG,並添加下面一行

group :production do 
gem 'pg', '0.12.2' 
end 

和執行,讓我知道,如果你面對什麼問題?