Ruby-build: rbenv-install 2.0.0-dev not installing OpenSSL?

Created on 11 Aug 2012  Â·  13Comments  Â·  Source: rbenv/ruby-build

I am attempting to play around with Rails 4 and after I install bundler and run bundle install I get the following message from Rails:

Could not load OpenSSL. You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available at rvm.io/packages/openssl.

What should I do? Is there a way to set MAKEOPTS while install ruby 2.0.0-dev? Thanks have a great weekend!

Most helpful comment

Ruby 2 is incompatible with the version of OpenSSL bundled with MacOS, so it doesn't compile the extension.

To work around, install OpenSSL using homebrew instead, then set the CONFIGURE_OPTS environment variable when you build Ruby:

CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`

All 13 comments

Ruby 2 is incompatible with the version of OpenSSL bundled with MacOS, so it doesn't compile the extension.

To work around, install OpenSSL using homebrew instead, then set the CONFIGURE_OPTS environment variable when you build Ruby:

CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`

just as you said.

This is probably not the right forum, so please bear with me. after running script/rails server in Rails 4 I get the following error:

activesupport/lib/active_support/dependencies.rb:243:inrequire': cannot load such file -- openssl (LoadError)`

I've installed OpenSSL via homebrew (i.e. home brew openssl). I am able to bundle install with no problem, and when using 1.9.3-p194 everything works as expected.

As a matter of troubleshooting I tried the install command suggested about:
rbenv install 2.0.0.-dev CONFIGURE_OPTS=--with-openssl-dir=brew --prefix openssl``

and then I tried this one:
rbenv install 2.0.0-dev CONFIGURE_OPTS=--openssl-includes=/usr/local/Cellar/openssl/1.0.1c/include --openssl-libpath=/usr/local/Cellar/openssl/1.0.1c/lib

Same result-error when firing up any rails server. This seems out of scope but given where you sit @jeremy I figured I'd share my experience.

Maybe try double-checking the environment variable:

$ export CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`"
$ echo $CONFIGURE_OPTS

problem solved. I was not setting the ENV var - cheers.

i have reinstall openssl with brew and excute the bellowing
➜ ~ export CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl --with-readline-dir=brew --prefix readline"
➜ ~ rbenv install 2.0.0-p0

but still failed and get the output:

ownloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226215116.53076
Results logged to /var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226215116.53076.log

I had a similar issue. Once I got over installing Ruby 2.0.0-p0 I had an
issue bundler as well.

I did the following to get my setup working:

gem install bundler -v 1.3.0.pre.7 --pre

Add this to .bash_profile
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl"

pre8 gave my system fits.

Hope this helps

rhodee

Kewin Wang wrote:

i have reinstall openssl with brew and excute the bellowing
➜ ~ export CONFIGURE_OPTS="--with-openssl-dir=|brew --prefix openssl|
--with-readline-dir=|brew --prefix readline|"
➜ ~ rbenv install 2.0.0-p0

but still failed and get the output:

ownloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...

BUILD FAILED

Inspect or clean up the working tree at
/var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226215116.53076
Results logged to
/var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226215116.53076.log

—
Reply to this email directly or view it on GitHub
https://github.com/sstephenson/ruby-build/issues/197#issuecomment-14115199.

@kewin2010 It should work if you replace CONFIGURE_OPTS with RUBY_CONFIGURE_OPTS. Note: it may not be necessary to specify these options at all. You may also want to try removing them.

@rhodee This issue has been fixed in the latest version of ruby-build. The following command should allow you to run the latest version of bundler:

cd ~/.rbenv/versions/2.0.0-p0/openssl/ssl
mv cacert.pem cert.pem

If this doesn't work, try upgrading and reinstalling 2.0.0-p0.

Thanks @erik, will give it a try and then report if anything doesn't go
as expected.

Erik Michaels-Ober wrote:

@kewin2010 https://github.com/kewin2010 It should work if you
replace |CONFIGURE_OPTS| with |RUBY_CONFIGURE_OPTS|. Note: it may not
be necessary to specify these options at all. You may also want to try
removing them.

@rhodee https://github.com/rhodee This issue has been fixed in the
latest version of |ruby-build|. The following command should allow you
to run the latest version of |bundler|:

cd ~/.rbenv/versions/2.0.0-p0/openssl/ssl
mv cacert.pem cert.pem

If this doesn't work, try upgrading and reinstalling 2.0.0-p0.

—
Reply to this email directly or view it on GitHub
https://github.com/sstephenson/ruby-build/issues/197#issuecomment-14120103.

Changed the compiler flags. That did not seem to help.

:~ nachtmusiktx$ echo $CONFIGURE_OPTS
--with-openssl-dir=/usr/local/opt/openssl
:~ nachtmusiktx$ rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/rh/mk90rlp54gg09txhyb1vphd00000gn/T/ruby-build.20130620100627.55251
Results logged to /var/folders/rh/mk90rlp54gg09txhyb1vphd00000gn/T/ruby-build.20130620100627.55251.log

Last 10 log lines:
installing default gems: /Users/nachtmusiktx/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

@nachtmusiktx This is also happening to me. Changing the flags did not fix anything; maintainers, any idea what this is all about?

I have not figured it out yet. A guy at work said he could not get 2.0 to
work, so he installed 1.9.

make sure you export your path. That does make a difference.

I am going to try to install 1.9 today and see if that goes any better.

Laura

On Thu, Jun 20, 2013 at 3:55 PM, Eudis Duran [email protected]:

@nachtmusiktx https://github.com/nachtmusiktx This is also happening to
me. Changing the flags did not fix anything; maintainers, any idea what
this is all about?

—
Reply to this email directly or view it on GitHubhttps://github.com/sstephenson/ruby-build/issues/197#issuecomment-19778947
.

Not sure about the Mac users, but I had this issue on my new Debian virtual machine and was perplexed as to why it was occurring when I had openssl installed. I researched a little bit, and eventually wound up with the solution of installing the development ssl library. This is what I did:

# apt-get install libssl-dev
$ rbenv install ruby-2.0.0-p247
Downloading ruby-2.0.0-p247.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
Installing ruby-2.0.0-p247...
Installed ruby-2.0.0-p247 to /home/joshua/.rbenv/versions/2.0.0-p247

I assume you can do the same thing with brew but I don't know for sure. Hope this helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

denisemauldin picture denisemauldin  Â·  4Comments

tom-mayer picture tom-mayer  Â·  3Comments

florentmorin picture florentmorin  Â·  5Comments

dpaluy picture dpaluy  Â·  6Comments

Lukom picture Lukom  Â·  5Comments