rubyjs / libv8

Ruby gem binary distribution of the V8 JavaScript engine
269 stars 121 forks source link

Using Rails, Bundle Install Fails. Even Gem Install is misleading #160

Closed AdamKyle closed 9 years ago

AdamKyle commented 9 years ago

in a rail 4.1.8 project with ruby 2.1.5, I have tried doing a bundle install only to come across:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/Adam/.rvm/rubies/ruby-2.1.5/bin/ruby extconf.rb 
creating Makefile
Compiling v8 for x64
Using python 2.7.6
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
                 ^
1 error generated.
make[1]: *** [/Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
    from /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
    from /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
    from /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in `install!'
    from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=x64 \
                  -S.x64  -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
  CXX(target) /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
  CXX(target) /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
  CXX(target) /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o

extconf failed, exit code 1

Gem files will remain installed in /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/gems/libv8-3.16.14.3 for inspection.
Results logged to /Users/Adam/Documents/Rails-Projects/AisisPlatform/.bundle/gems/extensions/x86_64-darwin-14/2.1.0/libv8-3.16.14.3/gem_make.out
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.

When attempting to do: gem install libv8 -v '3.16.14.3' it gives me a similar error, so after much research I was told you have to do:

gem install libv8 -v '3.16.14.3' -- --with-system-v8

Which I did, which then gave me:

Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.3
Parsing documentation for libv8-3.16.14.3
Done installing documentation for libv8 after 0 seconds
1 gem installed

So after words I did a gem list to make sure it was there and sure enough: libv8 (3.16.14.7, 3.16.14.3)

So I reran the bundle install and got the exact same error.

In a stack question I asked they said to use brew to install V8, well I did. Same error.

Is this a bug, do you not work with ruby 2.1.5?

ignisf commented 9 years ago

Can you provide us with the contents of the Gemfile and Gemfile.lock files of your project?

AdamKyle commented 9 years ago

Gem File

source 'https://rubygems.org'

gem 'rails', '4.1.5'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'therubyracer'
gem 'promiscuous', :git => 'git@github.com:promiscuous-io/promiscuous.git'
gem 'figaro'
gem "bower-rails", "~> 0.7.2"

gem 'rspec-rails', '2.99.0', group: [:test, :development]
gem 'letter_opener', group: [:development]

gem 'xaaron', '0.3.10', :git => 'git@github.com:AdamKyle/Xaaron.git', :tag => '0.3.10'
gem 'pry', require: 'pry'
gem 'pry-rails'

#Assets
gem "font-awesome-rails"

group :development do
  gem 'capistrano', '~> 2.15'
  gem 'rvm-capistrano', '~> 1.4'
end

group :test do
  gem 'database_cleaner'
  gem 'guard-rspec'
  gem 'factory_girl_rails'
  gem 'capybara'
  gem 'capybara-screenshot'
  gem 'capybara-email'
  gem 'simplecov', '0.8.2'
end

Gem Lock

GIT
  remote: git@github.com:AdamKyle/Xaaron.git
  revision: 91ee382428cfe8b05a3d8079ec2a8b2766456565
  tag: 0.3.10
  specs:
    xaaron (0.3.10)
      bcrypt (= 3.1.7)
      friendly_id (~> 5.0.3)
      pg
      rails (~> 4.1.5)
      simplecov (= 0.8.2)

GIT
  remote: git@github.com:promiscuous-io/promiscuous.git
  revision: f4aec9457b6399630be0a5db93929ac93d9ec5c9
  specs:
    promiscuous (1.0.0.beta5)
      activemodel (>= 3)
      activesupport (>= 3)
      algorithms (~> 0.6.1)
      amq-protocol (>= 1.8.0)
      bunny (>= 0.10.7)
      fnv (= 0.2.0)
      multi_json (~> 1.8.0)
      redis (~> 3.0)
      robust-redis-lock (~> 0.2.2)
      ruby-progressbar (~> 1.2.0)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.5)
      actionpack (= 4.1.5)
      actionview (= 4.1.5)
      mail (~> 2.5.4)
    actionpack (4.1.5)
      actionview (= 4.1.5)
      activesupport (= 4.1.5)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.5)
      activesupport (= 4.1.5)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.5)
      activesupport (= 4.1.5)
      builder (~> 3.1)
    activerecord (4.1.5)
      activemodel (= 4.1.5)
      activesupport (= 4.1.5)
      arel (~> 5.0.0)
    activesupport (4.1.5)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    addressable (2.3.6)
    algorithms (0.6.1)
    amq-protocol (1.9.2)
    arel (5.0.1.20140414130214)
    bcrypt (3.1.7)
    bower-rails (0.7.3)
    builder (3.2.2)
    bunny (1.4.0)
      amq-protocol (>= 1.9.2)
    capistrano (2.15.5)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    capybara (2.4.1)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    capybara-email (2.4.0)
      capybara (~> 2.4)
      mail
    capybara-screenshot (0.3.21)
      capybara (>= 1.0, < 3)
      colorize
      launchy
    celluloid (0.15.2)
      timers (~> 1.1.0)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.3.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.1)
    colorize (0.7.3)
    database_cleaner (1.3.0)
    diff-lcs (1.2.5)
    docile (1.1.5)
    erubis (2.7.0)
    execjs (2.2.1)
    factory_girl (4.4.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.4.1)
      factory_girl (~> 4.4.0)
      railties (>= 3.0.0)
    ffi (1.9.3)
    figaro (0.7.0)
      bundler (~> 1.0)
      rails (>= 3, < 5)
    fnv (0.2.0)
    font-awesome-rails (4.1.0.0)
      railties (>= 3.2, < 5.0)
    formatador (0.2.5)
    friendly_id (5.0.4)
      activerecord (>= 4.0.0)
    guard (2.6.1)
      formatador (>= 0.2.4)
      listen (~> 2.7)
      lumberjack (~> 1.0)
      pry (>= 0.9.12)
      thor (>= 0.18.1)
    guard-rspec (4.3.1)
      guard (~> 2.1)
      rspec (>= 2.14, < 4.0)
    highline (1.6.21)
    hike (1.2.3)
    i18n (0.6.11)
    jbuilder (1.5.3)
      activesupport (>= 3.0.0)
      multi_json (>= 1.2.0)
    jquery-rails (3.1.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    launchy (2.4.2)
      addressable (~> 2.3)
    letter_opener (1.2.0)
      launchy (~> 2.2)
    libv8 (3.16.14.3)
    listen (2.7.9)
      celluloid (>= 0.15.2)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    lumberjack (1.0.9)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    method_source (0.8.2)
    mime-types (1.25.1)
    mini_portile (0.6.0)
    minitest (5.4.0)
    multi_json (1.8.4)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (2.9.1)
    net-ssh-gateway (1.2.0)
      net-ssh (>= 2.6.5)
    nokogiri (1.6.3.1)
      mini_portile (= 0.6.0)
    pg (0.17.1)
    polyglot (0.3.5)
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    pry-rails (0.3.2)
      pry (>= 0.9.10)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.1.5)
      actionmailer (= 4.1.5)
      actionpack (= 4.1.5)
      actionview (= 4.1.5)
      activemodel (= 4.1.5)
      activerecord (= 4.1.5)
      activesupport (= 4.1.5)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.5)
      sprockets-rails (~> 2.0)
    railties (4.1.5)
      actionpack (= 4.1.5)
      activesupport (= 4.1.5)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.3.2)
    rb-fsevent (0.9.4)
    rb-inotify (0.9.5)
      ffi (>= 0.5.0)
    redis (3.1.0)
    ref (1.0.5)
    robust-redis-lock (0.2.2)
      redis (>= 3.0.0)
    rspec (2.99.0)
      rspec-core (~> 2.99.0)
      rspec-expectations (~> 2.99.0)
      rspec-mocks (~> 2.99.0)
    rspec-collection_matchers (1.0.0)
      rspec-expectations (>= 2.99.0.beta1)
    rspec-core (2.99.2)
    rspec-expectations (2.99.2)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.99.2)
    rspec-rails (2.99.0)
      actionpack (>= 3.0)
      activemodel (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-collection_matchers
      rspec-core (~> 2.99.0)
      rspec-expectations (~> 2.99.0)
      rspec-mocks (~> 2.99.0)
    ruby-progressbar (1.2.0)
    rvm-capistrano (1.5.3)
      capistrano (~> 2.15.4)
    sass (3.2.19)
    sass-rails (4.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0)
    simplecov (0.8.2)
      docile (~> 1.1.0)
      multi_json
      simplecov-html (~> 0.8.0)
    simplecov-html (0.8.0)
    slop (3.6.0)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.1.3)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    therubyracer (0.12.1)
      libv8 (~> 3.16.14.0)
      ref
    thor (0.19.1)
    thread_safe (0.3.4)
    tilt (1.4.1)
    timers (1.1.0)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turbolinks (2.3.0)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.5.3)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  bower-rails (~> 0.7.2)
  capistrano (~> 2.15)
  capybara
  capybara-email
  capybara-screenshot
  coffee-rails (~> 4.0.0)
  database_cleaner
  factory_girl_rails
  figaro
  font-awesome-rails
  guard-rspec
  jbuilder (~> 1.2)
  jquery-rails
  letter_opener
  pg
  promiscuous!
  pry
  pry-rails
  rails (= 4.1.5)
  rspec-rails (= 2.99.0)
  rvm-capistrano (~> 1.4)
  sass-rails (~> 4.0.0)
  simplecov (= 0.8.2)
  therubyracer
  turbolinks
  uglifier (>= 1.3.0)
  xaaron (= 0.3.10)!
ignisf commented 9 years ago

Looking at your Gemfile.lock I see that the libv8 version is locked to libv8 (3.16.14.3). There's a bunch of fixes for OSX since then.

ignisf commented 9 years ago

Not to mention that there's an OSX binary version of 3.16.14.7. Please consider updating.

AdamKyle commented 9 years ago

I have the 3.16.14.7 installed but every time I do a bundle install it keeps telling me it tries to install the .3 version.

ignisf commented 9 years ago

Yes, that's because this version is locked in your Gemfile.lock. You can update the version by issuing bundle update libv8 (see http://bundler.io/v1.7/man/bundle-update.1.html).

AdamKyle commented 9 years ago

Oh Understood thank you, I didn't know that.