Error installing libv8: ERROR: Failed to build gem native extension
I made a rails project with,
rails new test_bootstrap.
- How to install Serverspec in windows machine where internet is not there?
- Upgrading Ruby (1.9->2) & Rails(3.2->4) for Windows
- Rails Deployment Environment on Windows
- Displaying unix color on windows cmd (e.g. ←[31m)
- Why won't Heroku accept my Gemfile.lock in Windows?
- Running fork(2) from Windows with Cygwin. Possible?
moved to the project dir and added the gems
gem "therubyracer" gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS gem "twitter-bootstrap-rails"
after that, i have this error.
Installing libv8 (184.108.40.206) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb creating Makefile 지정된 경로를 찾을 수 없습니다. 지정된 경로를 찾을 수 없습니다. 지정된 경로를 찾을 수 없습니다. c:/RailsInstaller/Ruby1.9.3/lib/ruby/ge ms/1.9.1/gems/libv8-220.127.116.11/ext/libv8/builder.rb:58:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeErr or) from c:/RailsInstaller/Ruby1.9. 3/lib/ruby/gems/1.9.1/gems/libv8-18.104.22.168/ext/libv8/builder.rb:42:in `block in build_lib v8/builder.rb:42:in `block in build_libv8!' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-22.214.171.124/ext/lib v8/builder.rb:40:in `chdir' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-126.96.36.199/ext/lib v8/builder.rb:40:in `build_libv8!' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-188.8.131.52/ext/lib v8/location.rb:24:in `install!' from extconf.rb:7:in `<main>' Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/l ibv8-184.108.40.206 for inspection. Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-220.127.116.11/ex t/libv8/gem_make.out An error occurred while installing libv8 (18.104.22.168), and Bundler cannot continue. Make sure that `gem install libv8 -v '22.214.171.124'` succeeds before bundling.
sorry for some Koreans. It says, It can’t find the chosen path or something like that.
and i tried to run this command
gem install libv8 -v '126.96.36.199'
throwing the same error.
12 Solutions collect form web for “Error installing libv8: ERROR: Failed to build gem native extension”
try this one:
gem install libv8 -v '188.8.131.52' -- --with-system-v8
Note : Because libv8 is the interface for the V8 engine used by therubyracer,
you may need to use libv8, even if you have V8 installed already. If
you wish to use your own V8 installation, rather than have it built
for you, use the
For more you can go through the documentation of libv8 on github
How to resolve libv8/therubyracer issue
I encountered similar issue in which after installing libv8, error occurs installing therubyracer. Here is my solution:
$ gem install libv8 -v '184.108.40.206' -- --with-system-v8 $ bundle install
— see error installing therubyracer —
$ gem uninstall libv8 $ brew install v8 $ gem install therubyracer $ bundle install
— see error installing libv8 —
$ gem install libv8 -v '220.127.116.11' -- --with-system-v8
With homebrew this helps me to solve this error.
brew tap homebrew/versions brew install v8-315 gem install libv8 -v '18.104.22.168' -- --with-system-v8 gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 bundle install
Seen on rubyracer Github issues.
I tried the solution listed above command which looks very fine for installing individual gem, but for bundler users – you should use bundle config
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-system-v8
to configure bundler to take the parameters to be used while installing specific gem
I do not think you need
You can safely remove the gem from your Gemfile.
Rails is happy to use which ever runtime it can find.
nodejs etc. are all possible options.
Other workaround to fix the problem is to separate them in the Gemfile
group :production do gem 'libv8', '~> 22.214.171.124' gem 'therubyracer', :platform => :ruby end
And then run the bundle command: bundle install –without production
I was also unable to install this gem instead of using
once try to do bundle update which worked fine for me
My issue wasn’t related with
therubyracer at all just
libv8 gem and as @rishav-bhardwaj pointed
--with-system-v8 didn’t do the trick, instead i had to exec
The error is gone!
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing libv8 (126.96.36.199), and Bundler cannot continue.
Make sure that `gem install libv8 -v '188.8.131.52'` succeeds before bundling.
gem “therubyracer”, “~> 0.10.2” to Gemfile
And it will install dependent gem libv8 (184.108.40.206) and the issue of build gem native extension failure got resolve.
That works for me. Put that in your Gemfile
gem ‘libv8’, ‘~>220.127.116.11’
18.104.22.168 issue using below command:
gem install libv8 -v '22.214.171.124' -- --with-system-v8
bundle install successfully completed.
i feel this has less to do with libv8 and more to do with therubyracer.
i received your same error while running a bundle install on a rails app. if you have encountered this similarly, try installing the gem outside of bundle like so:
gem install therubyracer
then run bundle install. i hope this works for you too.