rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

Ubuntu 16.04 LTS in Failed to build gem native extension #433

Closed xlwindlx closed 7 years ago

xlwindlx commented 7 years ago

In AWS EC2 instance environments cd in the Project folder and type the "bundle install" I saw this error log

current directory: /home/ubuntu/parshing/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.12.3/ext/v8
/home/ubuntu/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20170214-13001-gkq1vt.rb extconf.rb
checking for main() in -lpthread... yes
creating Makefile

current directory: /home/ubuntu/parshing/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" clean

current directory: /home/ubuntu/parshing/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR="
compiling external.cc
make: g++: Command not found
Makefile:206: recipe for target 'external.o' failed
make: *** [external.o] Error 127

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/parshing/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /home/ubuntu/parshing/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/therubyracer-0.12.3/gem_make.out

An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.3'` succeeds before bundling.

uninstall libv8 can`t solve the problem what can I do?

ignisf commented 7 years ago

Hello,

You seem to be missing a compiler:

make: g++: Command not found

Consider installing the build-essential and ruby-dev packages.