将应用程序推送到heroku时出错(使用本机扩展错误安装linecache19(0.5.12))需要帮助!

时间:2011-06-12 19:29:31

标签: ruby-on-rails heroku

使用git push heroku master

将我的应用部署到heroku时出现此错误
-----> Heroku receiving push
-----> 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.0) 
       Installing abstract (1.0.0) 
       Installing activesupport (3.0.1) 
       Installing builder (2.1.2) 
       Installing i18n (0.4.2) 
       Installing activemodel (3.0.1) 
       Installing erubis (2.6.6) 
       Installing rack (1.2.3) 
       Installing rack-mount (0.6.14) 
       Installing rack-test (0.5.7) 
       Installing tzinfo (0.3.27) 
       Installing actionpack (3.0.1) 
       Installing mime-types (1.16) 
       Installing polyglot (0.3.1) 
       Installing treetop (1.4.9) 
       Installing mail (2.2.19) 
       Installing actionmailer (3.0.1) 
       Installing arel (1.0.1) 
       Installing activerecord (3.0.1) 
       Installing activeresource (3.0.1) 
       Installing archive-tar-minitar (0.5.2) 
       Installing columnize (0.3.2) 
       Installing ruby_core_source (0.1.5) 
       Installing linecache19 (0.5.12) with native extensions /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

       /usr/ruby1.9.2/bin/ruby extconf.rb 
       checking for vm_core.h... no
       checking for vm_core.h... no
       Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
       Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
       *** 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/ruby1.9.2/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/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Permission denied - /usr/ruby1.9.2/include/ruby-1.9.1/ruby-1.9.2-p180 (Errno::EACCES)
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `each'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
        from /disk1/tmp/build_2bk91kj0jaqmb/.bundle/gems/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/ruby1.9.2/lib/ruby/1.9.1/tempfile.rb:320:in `open'
        from /disk1/tmp/build_2bk91kj0jaqmb/.bundle/gems/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>'


       Gem files will remain installed in /disk1/tmp/build_2bk91kj0jaqmb/.bundle/gems/ruby/1.9.1/gems/linecache19-0.5.12 for inspection.
       Results logged to /disk1/tmp/build_2bk91kj0jaqmb/.bundle/gems/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
        from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
        from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
        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 git@heroku.com:young-planet-247.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:young-planet-247.git'

这是我的宝石文件

source 'http://rubygems.org'

gem 'rails', '3.0.1'

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

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3',:group => :development

##gem 'ruby-debug19', :require => 'ruby-debug',:group => :development

group :development do
  gem 'annotate-models', '1.0.4'
end

group :development, :test do if RUBY_VERSION =~ /1.9/ gem 'ruby-debug19' else gem 'ruby-debug' end end

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

Gemfile.lock的

 GEM
  remote: http://rubygems.org/
  specs:
    abstract (1.0.0)
    actionmailer (3.0.1)
      actionpack (= 3.0.1)
      mail (~> 2.2.5)
    actionpack (3.0.1)
      activemodel (= 3.0.1)
      activesupport (= 3.0.1)
      builder (~> 2.1.2)
      erubis (~> 2.6.6)
      i18n (~> 0.4.1)
      rack (~> 1.2.1)
      rack-mount (~> 0.6.12)
      rack-test (~> 0.5.4)
      tzinfo (~> 0.3.23)
    activemodel (3.0.1)
      activesupport (= 3.0.1)
      builder (~> 2.1.2)
      i18n (~> 0.4.1)
    activerecord (3.0.1)
      activemodel (= 3.0.1)
      activesupport (= 3.0.1)
      arel (~> 1.0.0)
      tzinfo (~> 0.3.23)
    activeresource (3.0.1)
      activemodel (= 3.0.1)
      activesupport (= 3.0.1)
    activesupport (3.0.1)
    annotate-models (1.0.4)
    archive-tar-minitar (0.5.2)
    arel (1.0.1)
      activesupport (~> 3.0.0)
    builder (2.1.2)
    columnize (0.3.3)
    erubis (2.6.6)
      abstract (>= 1.0.0)
    i18n (0.4.2)
    linecache19 (0.5.12)
      ruby_core_source (>= 0.1.4)
    mail (2.2.19)
      activesupport (>= 2.3.6)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.16)
    polyglot (0.3.1)
    rack (1.2.3)
    rack-mount (0.6.14)
      rack (>= 1.0.0)
    rack-test (0.5.7)
      rack (>= 1.0)
    rails (3.0.1)
      actionmailer (= 3.0.1)
      actionpack (= 3.0.1)
      activerecord (= 3.0.1)
      activeresource (= 3.0.1)
      activesupport (= 3.0.1)
      bundler (~> 1.0.0)
      railties (= 3.0.1)
    railties (3.0.1)
      actionpack (= 3.0.1)
      activesupport (= 3.0.1)
      rake (>= 0.8.4)
      thor (~> 0.14.0)
    rake (0.9.2)
    ruby-debug-base19 (0.11.25)
      columnize (>= 0.3.1)
      linecache19 (>= 0.5.11)
      ruby_core_source (>= 0.1.4)
    ruby-debug19 (0.11.6)
      columnize (>= 0.3.1)
      linecache19 (>= 0.5.11)
      ruby-debug-base19 (>= 0.11.19)
    ruby_core_source (0.1.5)
      archive-tar-minitar (>= 0.5.2)
    sqlite3-ruby (1.2.5)
    thor (0.14.6)
    treetop (1.4.9)
      polyglot (>= 0.3.1)
    tzinfo (0.3.27)

PLATFORMS
  ruby

DEPENDENCIES
  annotate-models (= 1.0.4)
  rails (= 3.0.1)
  ruby-debug19
  sqlite3-ruby (= 1.2.5)

我已经尝试了这里提到的步骤.. Install linecache via bundler on heroku

有人可以告诉我如何解决这个问题。

由于

2 个答案:

答案 0 :(得分:2)

该错误与ruby-debug19有关。从你的gemfile中删除它,它将在Heroku上编译。这与Heroku的环境有关。

答案 1 :(得分:2)

我的问题是我从我正在处理的分支中删除了ruby-debug19但是我忘了将它与主分支合并。我一直在推动主分支而没有我所做的更改