therubyracer fails to build on heroku
I've made a Rails 3.1 PoC application that also uses haml by adapting the examples from the railstutorial.org book and locally everything works fine.
But when I try to push to heroku, therubyracer fails to build on the server (full output):Installing therubyracer (0.8.2) with native extensions /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb开发者_Python百科:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
My Gemfile is pretty standard, so I would really appreciate if somebody could help me understand what's going wrong, and maybe give me a hand in finding a solution.
These answers are out of date. You can now just use therubyracer
in both environments so long as you have version '>= 0.11.2'
I should note that I am the author of therubyracer and use it in several production heroku apps both during asset compile time and at runtime
Heroku no longer requires, but strongly discourages using therubyracer
or therubyracer-heroku
, as these gems use a very large amount of memory.
If you are using them your next deploy will fail!
You have 2 choices:
Add
'therubyracer', :platforms => :ruby
to thegroup :assets
and upgrade your ruby version. Then remove your Gemfile.lock and runbundle install
.Run
assets:precompile
in your local machine and push them to heroku (don't forget to remove therubyracer gems from production);- Rails asset pipeline supports the Sass language by default. Instead of
rails-bootstrap
gem (LESS) you can usebootstrap-sass-rails
You need to use therubyracer-heroku.
Just define a pair of groups in your Gemfile to install the correct one where required.
group :development, :test do
gem 'therubyracer'
end
group :production do
gem 'therubyracer-heroku'
end
精彩评论