I made a rails project with,
rails new test_bootstrap.
succeeded.
moved to the project dir and added the gems
gem \
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
bundle update
then
bundle install
and finally
Bundle complete!
The error is gone!
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.
In my case I resolved this situation by requiring
'mini_racer', '~> 0.2.6'
in my Gemfile
Then bundle install command worked.
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.
With homebrew this helps me to solve this error.
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
Seen on rubyracer Github issues.
I was also unable to install this gem instead of using
--with-system-v8
once try to do bundle update which worked fine for me
I encountered similar issue in which after installing libv8, error occurs installing therubyracer. Here is my solution:
$ gem install libv8 -v '3.16.14.3' -- --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 '3.16.14.3' -- --with-system-v8