关于我在Heroku上的应用更新

时间:2012-10-26 14:16:07

标签: ruby-on-rails heroku

 Results logged to /tmp/build_207lfem2op1z3/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
       An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
       Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

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

所以请帮助我解决这个Iam新的Heroku和Ruby on rails

我已按照以下步骤更新了我的应用 git init git add。 git commit -m'。' git push heroku master

我遇到了以下运行错误

 saasbook@saasbook:~/hw2_rottenpotatoes$ git push heroku master
Counting objects: 462, done.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (462/462), 76.71 KiB, done.
Total 462 (delta 185), reused 427 (delta 172)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
       Fetching gem metadata from http://rubygems.org/.........
       Fetching gem metadata from http://rubygems.org/..
       Installing rake (0.9.2.2)
       Installing multi_json (1.0.4)
       Installing activesupport (3.1.0)
       Installing bcrypt-ruby (3.0.1) with native extensions
       Installing builder (3.0.0)
       Installing i18n (0.6.0)
       Installing activemodel (3.1.0)
       Installing erubis (2.7.0)
       Installing rack (1.3.6)
       Installing rack-cache (1.0.3)
       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.0)
       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.0)
       Installing arel (2.2.1)
       Installing tzinfo (0.3.31)
       Installing activerecord (3.1.0)
       Installing activeresource (3.1.0)
       Installing archive-tar-minitar (0.5.2)
       Installing coffee-script-source (1.2.0)
       Installing execjs (1.2.13)
       Installing coffee-script (2.2.0)
       Installing rack-ssl (1.3.2)
       Installing json (1.6.5) with native extensions
       Installing rdoc (3.12)
       Installing thor (0.14.6)
       Installing railties (3.1.0)
       Installing coffee-rails (3.1.1)
       Installing columnize (0.3.6)
       Installing haml (3.1.4)
       Installing jquery-rails (1.0.19)
       Installing libv8 (3.3.10.4)
       Installing ruby_core_source (0.1.5)
       Installing linecache19 (0.5.12) with native extensions
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /usr/local/bin/ruby extconf.rb
       checking for vm_core.h... no
       checking for vm_core.h... no
       *** extconf.rb failed ***
       Could not create Makefile due to some reason, probably lack of
       necessary libraries and/or headers.  Check the mkmf.log file for more
       details.  You may need configuration options.
       Provided configuration options:
       --with-opt-dir
       --without-opt-dir
       --with-opt-include
       --without-opt-include=${opt-dir}/include
       --with-opt-lib
       --without-opt-lib=${opt-dir}/lib
       --with-make-prog
       --without-make-prog
       --srcdir=.
       --curdir
       --ruby=/usr/local/bin/ruby
       --with-ruby-dir
       --without-ruby-dir
       --with-ruby-include
       --without-ruby-include=${ruby-dir}/include
       --with-ruby-lib
       --without-ruby-lib=${ruby-dir}/lib
       /usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Read-only file system - /usr/local/include/ruby-1.9.1/ruby-1.9.2-p290 (Errno::EROFS)
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `each'
       from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
       from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core'
       from /usr/local/lib/ruby/1.9.1/tempfile.rb:320:in `open'
       from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
       from extconf.rb:19:in `<main>'
       Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
       Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
       Gem files will remain installed in /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12 for inspection.
       Results logged to /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
       An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
       Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

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

Iam发布我的Gem文件

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# 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 'therubyracer'              
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

gem 'jquery-rails'

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

# Deploy with Capistrano
# gem 'capistrano'

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

2 个答案:

答案 0 :(得分:0)

  

安装linecache19(0.5.12)时发生错误,Bundler无法继续。

通常,您只会在开发中使用ruby-debug gem,而不是在生产中。确保ruby-debug中的:development:test组中有Gemfile

group :development, :test do
  gem 'ruby-debug19', :require => 'ruby-debug'
end

然后尝试以下

  1. 再次运行bundle
  2. 提交您的GemfileGemfile.lock
  3. 再次推送到Heroku

答案 1 :(得分:0)

linecache19作为ruby-debug19的依赖项安装,您无论如何都不想拥有它。

在Gemfile中,替换显示

的行
gem 'ruby-debug19', :require => 'ruby-debug'

用这个

group :development, :test do
  gem 'ruby-debug19', require: 'ruby-debug'
end

这意味着调试器仅在开发和测试环境中加载。

你也会遇到Heroku不支持sqlite3的麻烦......请参阅this question