avvo / docker-ruby

Our base ruby image. Do not use the image, see https://github.com/avvo/docker-base instead
4 stars 1 forks source link

Can't install libv8 gem #3

Open dplummer opened 8 years ago

dplummer commented 8 years ago

With the rails template I'm unable to install the libv8 gem:

Installing libv8 3.16.14.13 with native extensions

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

    /usr/bin/ruby -r ./siteconf20160505-5-1shz4s3.rb extconf.rb
creating Makefile
/srv/billboard/vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.13/ext/libv8/builder.rb:81:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError)
    from /srv/billboard/vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.13/ext/libv8/builder.rb:55:in `block in build_libv8!'
    from /srv/billboard/vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.13/ext/libv8/builder.rb:52:in `chdir'
    from /srv/billboard/vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.13/ext/libv8/builder.rb:52:in `build_libv8!'
    from /srv/billboard/vendor/bundle/ruby/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:24:in `install!'
    from extconf.rb:7:in `<main>'

extconf failed, exit code 1

...

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

I tried adding the nodejs package to the apk add command, but got same result.

reneklacan commented 7 years ago

@dplummer Did you have any luck with this? I'm currently facing same problem :(

dplummer commented 7 years ago

@reneklacan Looks like added the following to my Dockerfile to get it to work:

RUN gem install -N libv8 -v '3.16.14.13' -- --with-system-v8 \
 && bundle config --global build.libv8 --with-system-v8
reneklacan commented 7 years ago

@dplummer In the meanwhile I solved it by doing RUN ln -s /usr/bin/python2.7 /usr/bin/python2 as I discovered python 2 was there but binary was python2.7 and there was no python2