ruby-on-rails - 如何推送 heroku master?

标签 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之后就没有错误了。但我又看到了。 这是我的 gemfile

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

为什么?

最佳答案

你可以更改为 pg 并添加以下行吗

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

然后执行,如果遇到任何问题请告诉我?

关于ruby-on-rails - 如何推送 heroku master?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8248289/

相关文章:

ruby-on-rails - 尝试在 Rails 中使用自定义 DeliveryMethod 时出现无效的传递方法错误

ruby - 货架搬运工具体做什么?

ruby-on-rails - ActionController::RoutingError(没有路由匹配 [GET] "/assets/blah.png") Heroku

python - Heroku:错误 R10(启动超时)-> Web 进程未能在启动后 60 秒内绑定(bind)到 $PORT - Python

android - 尝试在设备上运行 calabash-android 测试时获取 "App did not start (RuntimeError)"

java - 将 Play 应用程序推送到 Heroku 会导致 "Heroku push rejected, no Cedar-supported app detected"错误

ruby-on-rails - rake 数据库 :reset Drop all tables but not database

ruby-on-rails - 让 ActiveAdmin 使用包含日期过滤器?

javascript - 使用 Rails 创建 powerpoint 演示文稿

ruby-on-rails - 使用 Jenkins 对 Ruby on Rails 进行持续集成测试