【问题标题】:Heroku - therubyracer -v '0.11.0beta8' failsHeroku - therubyracer -v '0.11.0beta8' 失败
【发布时间】:2012-08-11 09:22:58
【问题描述】:
Installing therubyracer (0.11.0beta8) with native extensions
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /tmp/build_2c9eqd3g9wxzt/vendor/ruby-1.9.3/bin/ruby extconf.rb
       checking for main() in -lpthread... yes
       creating Makefile
       make
       compiling locker.cc
       compiling context.cc
       compiling primitive.cc
       compiling v8.cc
       compiling handles.cc
       compiling string.cc
       compiling date.cc
       compiling exception.cc
       compiling heap.cc
       compiling backref.cc
       compiling script.cc
       compiling function.cc
       compiling invocation.cc
       compiling init.cc
       compiling external.cc
       compiling rr.cc
       compiling array.cc
       compiling value.cc
       compiling template.cc
       compiling constraints.cc
       compiling constants.cc
       compiling trycatch.cc
       compiling stack.cc
       compiling accessor.cc
       compiling message.cc
       compiling signature.cc
       compiling object.cc
       compiling gc.cc
       linking shared-object v8/init.so
       /tmp/build_2c9eqd3g9wxzt/vendor/bundle/ruby/1.9.1/gems/libv8-3.11.8.3-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: No such file or directory
       collect2: ld returned 1 exit status
       make: *** [init.so] Error 1
       Gem files will remain installed in /tmp/build_2c9eqd3g9wxzt/vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0beta8 for inspection.
       Results logged to /tmp/build_2c9eqd3g9wxzt/vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0beta8/ext/v8/gem_make.out
       An error occurred while installing therubyracer (0.11.0beta8), and Bundler cannot continue.
       Make sure that `gem install therubyracer -v '0.11.0beta8'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

我在这里可能做错了什么?几天来,我一直在尝试修复此错误,但没有运气。这是一个有点有害的问题,因为如果我尝试在没有它的情况下进行捆绑,我会收到一个错误,它依赖于它的 twitter 引导程序。我也尝试过使用以前版本的 therubyracer,但是当我这样做时,我得到了同样的错误,并给出了“确保 `gem install therubyracer -v '0.11.0beta8' 在捆绑之前成功”的建议。任何帮助都会很棒!

更新:

当我根本不将 ruby​​racer 包含在生产中时,我会得到:(heroku 日志)

2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-08-15T02:15:24+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2012-08-15T02:15:26+00:00 heroku[web.1]: Process exited with status 1
2012-08-15T02:15:26+00:00 heroku[web.1]: State changed from starting to crashed
2012-08-15T02:33:23+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-15T02:33:27+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 57351`


2012-08-15T02:33:42+00:00 app[web.1]: **/app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/context.rb:74:in `IsEntered': HandleScope::HandleScope: Entering the V8 API without proper locking in place (fatal)**


2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:74:in `open'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/context.rb:74:in `enter'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:18:in `block in []='
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:17:in `tap'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:17:in `[]='
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/context.rb:58:in `[]='
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-2.2.1/lib/less/loader.rb:12:in `initialize'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `new'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bundler/gems/twitter-bootstrap-rails-86cffd500849/lib/twitter-bootstrap-rails.rb:9:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:68:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:55:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/config/application.rb:10:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:66:in `block in require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:55:in `each'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:66:in `each'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler.rb:128:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/config/environment.rb:2:in `<top (required)>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
2012-08-15T02:33:42+00:00 app[web.1]:   from config.ru:3:in `block in <main>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/config/environment.rb:2:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from config.ru:1:in `new'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start'
2012-08-15T02:33:42+00:00 app[web.1]:   from config.ru:1:in `<main>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-08-15T02:33:42+00:00 app[web.1]:   from config.ru:3:in `require'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-08-15T02:33:42+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-08-15T02:33:43+00:00 heroku[web.1]: Process exited with status 1
2012-08-15T02:33:43+00:00 heroku[web.1]: State changed from starting to crashed
2012-08-15T02:37:06+00:00 heroku[slugc]: Slug compilation started
2012-08-15T02:37:53+00:00 heroku[api]: Release v9 created by joshua.chestang@gmail.com
2012-08-15T02:37:53+00:00 heroku[api]: Deploy 5bad9a2 by joshua.chestang@gmail.com
2012-08-15T02:37:53+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-15T02:37:54+00:00 heroku[slugc]: Slug compilation finished
2012-08-15T02:37:58+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 36867`





 **2012-08-15T02:38:11+00:00 app[web.1]: [WARNING] Please install gem 'therubyracer' to use Less.**
    2012-08-15T02:38:11+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:74:in `require': cannot load such file -- twitter/bootstrap/rails (LoadError)**
    2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:62:in `block in require'


2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:55:in `each'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:74:in `rescue in block in require'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler/runtime.rb:55:in `require'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.0.rc.2/lib/bundler.rb:128:in `require'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/config/application.rb:10:in `<top (required)>'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/config/environment.rb:2:in `require'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/config/environment.rb:2:in `<top (required)>'
2012-08-15T02:38:11+00:00 app[web.1]:   from config.ru:3:in `block in <main>'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-08-15T02:38:11+00:00 app[web.1]:   from config.ru:3:in `require'
2012-08-15T02:38:11+00:00 app[web.1]:   from config.ru:1:in `<main>'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-08-15T02:38:11+00:00 app[web.1]:   from config.ru:1:in `new'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2012-08-15T02:38:11+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2012-08-15T02:38:12+00:00 heroku[web.1]: Process exited with status 1
2012-08-15T02:38:12+00:00 heroku[web.1]: State changed from starting to crashed

宝石文件:

source 'http://rubygems.org'

ruby '1.9.3'
gem  'rails', '3.2.8'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
  gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
end

group :development, :test do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
  gem 'thin'
end


gem "heroku"

gem 'libv8', '~> 3.11.8'


gem 'json', '~> 1.6.5'

gem "multi_json", "~> 1.3.6"

#attachment management
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"

#ativity feed
gem 'public_activity', :git => "git://github.com/pokonski/public_activity.git"

gem 'jquery-rails'

#nested-album-form
gem 'nested_form', :git => 'https://github.com/ryanb/nested_form.git'

#creates pattern for widget to send form data in json back to server
gem "js_message"

gem 'kaminari'

#gem 'will_paginate'


#user authentication
gem 'devise'

#notification - basic
gem 'unread'

#id3 tag reader for songs
#gem "taglib-ruby", '~> 0.5.1'

#admin interface
gem 'activeadmin', :git => 'git://github.com/gregbell/active_admin.git'

#gravatar images for users with no profile picture
gem 'gravatar_image_tag'

#amazon s3 for song storage
gem 'aws-sdk'

#authentication for twitter
gem 'omniauth-twitter'

#pretty urls
gem 'friendly_id'

gem 'tire'

group :development do
  gem 'rspec-rails'
  gem 'nifty-generators'
  gem 'annotate'
  gem 'faker'
end

group :test do
  gem 'rspec-rails'
  gem 'webrat'
  gem 'spork', '~> 0.9.0.rc'
  gem 'factory_girl_rails'
  gem 'watchr'
end

#?
gem 'progress_bar'

#web intents - twitter
gem 'tweet-button'



#like buttons
gem 'facebook_share'

#rails paypal interfacing
gem 'activemerchant', :require => 'active_merchant'

#gem 'bootstrap-will_paginate'

gem 'bootstrap-kaminari-views'

gem 'omniauth-facebook'

gem 'simple_form'

gem 'country_select'

# gem 'tiny_tds'
# gem 'activerecord-sqlserver-adapter'
# gem 'ruby-odbc'

# 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 'debugger'

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

【问题讨论】:

    标签: ruby-on-rails twitter-bootstrap heroku therubyracer


    【解决方案1】:

    你试过这个吗? https://github.com/aler/therubyracer-heroku

    见therubyracer fails to build on heroku


    刚刚查看了 heroku 文档 - https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar

    红宝石赛车

    如果您之前使用的是 therubyracer 或 therubyracer-heroku, 不再需要这些宝石,并且强烈建议不要使用这些宝石 gem 占用大量内存。

    如果您在生产部署中不包含 ruby​​racer,会发生什么情况?

    【讨论】:

    • 我收到三个错误。有人说我需要安装 therubyracer 才能使用 Less。我更新了我的问题并添加了我的 heroku 日志文件。星号线是我认为的相关错误。
    • 我也会将您的 Gemfile 添加到帖子中 - 可能要考虑预编译您的资产,将它们检入 git 并以这种方式推送?
    • 可能想尝试 heroku 谷歌组或创建支持票 - 最坏的情况,在本地编译您的资产并将它们推送到预编译的 heroku
    • Heroku 反对使用 therubyracer 和 therubyracer-heroku gems
    【解决方案2】:

    但是 heroku 不鼓励使用 therubyracer gems,很难在不损害应用程序的情况下从现有项目中删除它。

    所以有一个解决方案(see)。

    将 'therubyracer', :platforms => :ruby 添加到 :assets 组并升级您的 ruby​​ 版本。然后删除您的 Gemfile.lock 并运行捆绑安装。

    例子:

    group :assets do
      gem 'therubyracer', :platforms => :ruby 
    end
    
    gem "less-rails"
    gem "twitter-bootstrap-rails"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-01
      • 1970-01-01
      • 2016-01-25
      • 2020-10-06
      • 2012-06-09
      • 2011-09-09
      • 2018-06-16
      • 2020-05-06
      相关资源
      最近更新 更多