如何推动heroku高手?

时间:2011-11-23 19:55:13

标签: ruby-on-rails ruby heroku installation

我试着推,我看到了:

rusik@rusik-K50AF:~/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 git@heroku.com:furious-river-2242.git  ! [remote rejected] master
-> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com:furious-river-2242.git'

因此,它看起来像this 我在gemfile中将db更改为pg + bundle install,并且在bundler之后没有错误。但我又看到了。 这是我的宝石文件

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

为什么?

1 个答案:

答案 0 :(得分:1)

您可以更改pg并添加以下行

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

并执行并告诉我您是否遇到任何问题?