Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbenv-install 2.0.0-dev not installing OpenSSL? #197

Closed
rhodee opened this issue Aug 11, 2012 · 13 comments
Closed

rbenv-install 2.0.0-dev not installing OpenSSL? #197

rhodee opened this issue Aug 11, 2012 · 13 comments

Comments

@rhodee
Copy link

rhodee commented Aug 11, 2012

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!

@jeremy
Copy link
Member

jeremy commented Aug 11, 2012

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`

@jeremy jeremy closed this as completed Aug 11, 2012
@rhodee
Copy link
Author

rhodee commented Aug 11, 2012

just as you said.

@rhodee
Copy link
Author

rhodee commented Aug 11, 2012

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.

@jeremy
Copy link
Member

jeremy commented Aug 11, 2012

Maybe try double-checking the environment variable:

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

@rhodee
Copy link
Author

rhodee commented Aug 11, 2012

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

@kewinwang
Copy link

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

@rhodee
Copy link
Author

rhodee commented Feb 26, 2013

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
#197 (comment).

@sferik
Copy link
Contributor

sferik commented Feb 26, 2013

@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.

@rhodee
Copy link
Author

rhodee commented Feb 26, 2013

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
#197 (comment).

@nachtmusiktx
Copy link

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?

@eudisd
Copy link

eudisd commented Jun 20, 2013

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

@nachtmusiktx
Copy link

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 notifications@github.comwrote:

@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//issues/197#issuecomment-19778947
.

@jo-sm
Copy link

jo-sm commented Jul 15, 2013

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants