I am using a Dockerfile
to build a custom ruby
image as follows:
FROM debian:9
RUN apt-get update \
&& apt-get install -y \
build-essential \
gcc \
openssl \
procps \
wget \
zlib1g-dev \
&& cd /tmp \
&& wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz \
&& tar -xvzf ruby-2.0.0-p0.tar.gz \
&& ls -al \
&& cd ruby-2.0.0-p0 \
&& ./configure \
&& make \
&& make install
USER someuser
WORKDIR /home/someuser
The build finishes OK.
As a matter of fact, from within the image:
$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
But when I spin up the image and try to install bundler
$ gem install bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Why is that, given I have installed openssl
?
edit: It is NOT a duplicate of this because (although I am using OSX) I am compiling ruby
WITHIN a debian:9
image and openssl
gets installed within the image (Dockerfile
)
edit: installing libssl-dev
as also indicated in the potential duplicate question does not solve the issue either:
(custom-ruby)*➣ $ docker run -it --user=root pkaramol/test-ruby-new bash
root@bde5e149ced7:/home/someuser# dpkg -l | grep -i ssl
ii libssl-dev:amd64 1.1.0j-1~deb9u1 amd64 Secure Sockets Layer toolkit - development files
ii libssl-doc 1.1.0j-1~deb9u1 all Secure Sockets Layer toolkit - development documentation
ii libssl1.1:amd64 1.1.0j-1~deb9u1 amd64 Secure Sockets Layer toolkit - shared libraries
ii openssl 1.1.0j-1~deb9u1 amd64 Secure Sockets Layer toolkit - cryptographic utility
root@bde5e149ced7:/home/someuser# gem install bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass