Hi everybody,
I just installed the current ruby 2.0.0p0 on a Mac OS 10.8.2.
$ ruby --version
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
Then I want to install my gems as usual:
$ gem install terminal-notifier
ERROR: Loading command: install (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass
I remember reading that ruby 2.0 is not using the SSL gem anymore, but
the system installed openssl instead. I guess this is the problem here,
but there is an openssl available in my $PATH:
$ which openssl
/usr/bin/openssl
I guess this is an FAQ, but could not find anything related. What is the
prefereed way to fix this? Do I have to explicitly tell ruby where the
openssl lives?
Many TIA,
Jan H.
On 27.02.2013, at 10:32, Dr. Hegewald [email protected] wrote:
$ which openssl
/usr/bin/openssl
Sorry, forgot to add openssl version:
$ openssl version
OpenSSL 0.9.8r 8 Feb 2011
Cheers,
Jan H.
Subject: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 06:32:24 +0900
Quoting Dr. Hegewald ([email protected]):
Then I want to install my gems as usual:
$ gem install terminal-notifier
ERROR: Loading command: install (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass
If you compile from source, try to go to <path_of_source>/ext/openssl,
and type this:
ruby extconf.rb
make
sudo make install
Does the process complete without errors? If so, you should at this
point try again the gem loading command.
Carlo
Subject: Re: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 07:18:50 +0900
Quoting Dr. Hegewald ([email protected]):
that does not seem to work:
So that’s the reason. Of course if you download openssl (latest is
http://www.openssl.org/source/openssl-1.0.1e.tar.gz
), compile and install it, it should be installed under
/usr/local. Then, when you call extconf.rb you should pick it in
preference of the default Apple version. And compilation of the Ruby
openssl extensions should proceed OK.
Of course, I cannot guarantee anything about this as I am too poor to
own a mac ;-). Also, there is another caveat: I have no idea
whatsoever if the other apps in MacOS will be happy about the
change. You could open a can of worms…
The other path is to learn how to install Openssl in another directory
(read the INSTALL file), and then include the path where the new
openssl.pc file is stored after you run make install at the beginning
of the PKG_CONFIG_PATH shell variable, before executing extconf.rb.
This way, you will keep two separate copies, and Ruby will always use
the newer one, while the rest will still find the old one.
Good luck!
Carlo
Hi all,
On 27.02.2013, at 11:18, “Dr. Hegewald” [email protected] wrote:
extconf.rb:62:in <main>': Ignore OpenSSL broken by Apple. (RuntimeError) Please use another openssl. (e.g. using
configure
–with-openssl-dir=/path/to/openssl’)
OK, I installed another openssl (OpenSSL 1.0.1e 11 Feb 2013) and tried
to tell configure about it using the above mentioned flag:
$ ./configure --with-openssl-dir=/Users/me/bin/openssl-1.0.1e-bin/bin
–prefix=/Users/me/bin/ruby-2.0.0-p0-bin
configure: WARNING: unrecognized options: --with-openssl-dir
Huh? What is that?
Cheers,
Jan
Hi Carlo and all,
On 27.02.2013, at 11:45, “Carlo E. Prelz” [email protected] wrote:
http://www.openssl.org/source/openssl-1.0.1e.tar.gz
), compile and install it, it should be installed under
/usr/local. Then, when you call extconf.rb you should pick it in
preference of the default Apple version. And compilation of the Ruby
openssl extensions should proceed OK.
No, I do not want to change the default openssl. This would require
admin access and probably messes with other things.
Of course, I cannot guarantee anything about this as I am too poor to
own a mac ;-). Also, there is another caveat: I have no idea
whatsoever if the other apps in MacOS will be happy about the
change. You could open a can of worms
(-:
The other path is to learn how to install Openssl in another directory
I did that, see my previous mail.
then include the path where the new
openssl.pc file is stored after you run make install at the beginning
of the PKG_CONFIG_PATH shell variable, before executing extconf.rb.
Sorry, this description is to compact for me to follow. Do I still need
to pass --with-openssl-dir to configure?
Many thanks,
Jan
Hi Carlo and all,
On 27.02.2013, at 10:45, Carlo E. Prelz [email protected] wrote:
undefined method `invoke_with_build_args’ for nil:NilClass
If you compile from source, try to go to <path_of_source>/ext/openssl,
and type this:
ruby extconf.rb
that does not seem to work:
$ ruby extconf.rb
checking for t_open() in -lnsl… no
checking for socket() in -lsocket… no
checking for assert.h… yes
checking for openssl/ssl.h… yes
checking for OpenSSL_add_all_digests() in -lcrypto… yes
checking for SSL_library_init() in -lssl… yes
checking for openssl/conf_api.h… yes
checking for SSL_library_init() in openssl/ssl.h with
-Werror=deprecated-declarations… no
extconf.rb:62:in <main>': Ignore OpenSSL broken by Apple. (RuntimeError) Please use another openssl. (e.g. using
configure
–with-openssl-dir=/path/to/openssl’)
So do I really have to install another openssl? If I do so, can I
exclude it from my $PATH, as it is set via --with-openssl-dir ?
Cheers,
Jan
Subject: Re: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 07:58:37 +0900
Quoting Dr. Hegewald ([email protected]):
The other path is to learn how to install Openssl in another directory
I did that, see my previous mail.
then include the path where the new
openssl.pc file is stored after you run make install at the beginning
of the PKG_CONFIG_PATH shell variable, before executing extconf.rb.
Sorry, this description is to compact for me to follow. Do I still
need to pass --with-openssl-dir to configure?
This is a bit off-topic for this list, so I will have to be concise.
Say you want to install openssl in /path/to/install:
-
mkdir -p /path/to/install
-
(from the source of openssl)
./Configure darwin64-x86_64-cc --prefix=/path/to/install
–openssldir=/path/to/install/openssl/
make
make install
-
(from …/ruby/ext/openssl)
export PKG_CONFIG_PATH=/path/to/install/lib/pkgconfig:$PKG_CONFIG_PATH
make clean
ruby extconf.rb
make
make install
If this fails, you should seek help from someone who knows more than I
do about macos.
Carlo
Subject: Re: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 11:19:26 +0900
Quoting Dr. Hegewald ([email protected]):
- (from …/ruby/ext/openssl)
export PKG_CONFIG_PATH=/path/to/install/lib/pkgconfig:$PKG_CONFIG_PATH
make clean
ruby extconf.rb
This command fails with the same error as before,
Are you sure you executed the export command correctly? What do you
get if you type
echo $PKG_CONFIG_PATH
? And if you type
ls -al /path/to/install/lib/pkgconfig
? Also, the contents of the mkmf.log file may be useful.
Many thanks for your efforts here Carlo. But I think I have to go
back to ruby 1.9.3 until I get new input on the issue.
Maybe… Somebody who regularly uses Ruby under Mac will eventually
offer the right solution.
Carlo
On Wed, Feb 27, 2013 at 3:32 AM, Dr. Hegewald [email protected]
wrote:
ERROR: Loading command: install (LoadError)
cannot load such file – openssl
Take a look at ruby-build. It handles the ins & outs of compiling Ruby
on the Mac, including OpenSSL:
Otherwise, you’ll need to build openssl, configure Ruby
–with-openssl-dir, and fetch your own root CA certificates. Big song
and dance.
RVM can wrap this up for you, too: RVM: Ruby Version Manager - Installing RVM
(I wish Ruby kept support for Apple’s patched OpenSSL, even though
it’s deprecated and broken.)
Hi Carlo and all,
On 27.02.2013, at 14:33, “Carlo E. Prelz” [email protected] wrote:
openssl.pc file is stored after you run make install at the beginning
of the PKG_CONFIG_PATH shell variable, before executing extconf.rb.
Sorry, this description is to compact for me to follow. Do I still
need to pass --with-openssl-dir to configure?
This is a bit off-topic for this list, so I will have to be concise.
Ups, do you know a better list for questions about compiling ruby?
Say you want to install openssl in /path/to/install:
openssl compiles and installed just fine. It is OpenSSL 1.0.1e 11 Feb
2013, as I wrote previously.
- (from …/ruby/ext/openssl)
export PKG_CONFIG_PATH=/path/to/install/lib/pkgconfig:$PKG_CONFIG_PATH
make clean
ruby extconf.rb
This command fails with the same error as before,
extconf.rb:62:in <main>': Ignore OpenSSL broken by Apple. (RuntimeError) Please use another openssl. (e.g. using
configure
–with-openssl-dir=/path/to/openssl’)
And the suggested solution does not work, as the ruby configure does not
understand the --with-openssl-dir flag.
Many thanks for your efforts here Carlo. But I think I have to go back
to ruby 1.9.3 until I get new input on the issue.
Cheers,
Jan H.
On Wed, Feb 27, 2013 at 7:27 AM, Jeremy K. [email protected]
wrote:
RVM can wrap this up for you, too: RVM: Ruby Version Manager - Installing RVM
Yep, I just installed Ruby 2.0 using rvm on a Mac (10.7.5) that has
the old Apple ‘OpenSSL 0.9.8r 8 Feb 2011’ with no problem.
I have spent the last couple of days struggling to get Ruby 2.0 to
compile under Mac OS X 10.8.2 using first RVM and as of last night
Chruby. I
have come to realize the full extent of this openssl issue after trying
to follow the instructions at
• I am using Homebrew so I installed openssl and am also having the
issue that trying to use --with-openssl-dir option on ./configure is not
working.
• Compiling Ruby 2.0 without this works, but then I cannot install
Bundler 1.3
because it can’t find openssl, so I am dead in the water at that point.
I would also appreciate some clear syntax and steps to compile Ruby 2.0
properly under Mac OS X, of course in my case using Homebrew and Chruby.
This is turning out to be much harder than I thought and from what I see
has been a known issue for some months.
Any help or link to a site would be appreciated. I have Googled till my
eyes bled and unfortunately the best site I found was mostly in
Japanese.
On Wed, Feb 27, 2013 at 12:09 PM, guillermo haas-thompson
[email protected] wrote:
I would also appreciate some clear syntax and steps to compile Ruby 2.0
properly under Mac OS X, of course in my case using Homebrew and Chruby.
This is turning out to be much harder than I thought and from what I see
has been a known issue for some months.
chruby works well with ruby-build.
Use ruby-build to install 2.0.0-p0. It’ll handle the OpenSSL setup.
On Wed, Feb 27, 2013 at 9:41 AM, Hassan S.
[email protected] wrote:
Yep, I just installed Ruby 2.0 using rvm on a Mac (10.7.5) that has
the old Apple ‘OpenSSL 0.9.8r 8 Feb 2011’ with no problem.
10.7.x does not have this issue.
Jeremy K. wrote in post #1099453:
On Wed, Feb 27, 2013 at 12:09 PM, guillermo haas-thompson
[email protected] wrote:
I would also appreciate some clear syntax and steps to compile Ruby 2.0
properly under Mac OS X, of course in my case using Homebrew and Chruby.
This is turning out to be much harder than I thought and from what I see
has been a known issue for some months.
chruby works well with ruby-build.
Use ruby-build to install 2.0.0-p0. It’ll handle the OpenSSL setup.
GitHub - rbenv/ruby-build: Compile and install Ruby
I have been reading around and it looks like there were still problems
even when using ruby-build
(OpenSSL 1.0.1e downloaded via ruby-build fails to build on OSX 10.8.2 · Issue #305 · rbenv/ruby-build · GitHub) and so it seems
like maybe I should uninstall my Homebrew openssl beforehand if I decide
to give it a whirl with ruby-build. I was hoping to be able to avoid
that and just compile from source.
On Wed, Feb 27, 2013 at 2:55 PM, Jeremy K. [email protected]
wrote:
10.7.x does not have this issue.
So what exactly is the issue, if not the version of OpenSSL?
To recap:
• I installed openssl via Homebrew
• I completely removed RVM and went with Chruby
• Was following the instructions for 2.0.0 at
In my comment above, where I reference ruby-build issue #305, a user
under that thread said: “configure: WARNING: unrecognized options:
–with-openssl-dir
Confusingly, this is normal. Ruby doesn’t recognize the option, but the
openssl extension does.”
So, taking a leap of faith and combining that with the Chruby wiki, the
final command that appears to have worked for me is:
./configure --prefix=/opt/rubies/ruby-2.0.0-p0 --with-openssl-dir=brew --prefix openssl
--with-readline-dir=brew --prefix readline
–with-yaml-dir=brew --prefix libyaml
--with-gdbm-dir=brew --prefix gdbm
--with-libffi-dir=brew --prefix libffi
The trick is to completely ignore the error message spit back from
./configure about not knowing what any of these --with options are and
go ahead with the rest of the instructions on building and installing
the makefile.
Finally, I just cd’d into my app with Ruby 2.0.0 and was able to “gem
install bundler” without getting an openssl failure. First time I tried
to bundle my gems though, I did get an SSL error.
And finally:
• Got an email back from Postmodern with this lifesaver
On 27.02.2013, at 16:03, Carlo E. Prelz [email protected] wrote:
This command fails with the same error as before,
Are you sure you executed the export command correctly?
I guess it is OK:
$ ls -l $PKG_CONFIG_PATH
total 24
-rw-r–r-- 1 me we 288 27 Feb 11:35 libcrypto.pc
-rw-r–r-- 1 me we 303 27 Feb 11:35 libssl.pc
-rw-r–r-- 1 me we 313 27 Feb 11:35 openssl.pc
? Also, the contents of the mkmf.log file may be useful.
This is the openssl/mkmf.log:
Ignore OpenSSL broken by Apple.
Please use another openssl. (e.g. using `configure
–with-openssl-dir=/path/to/openssl’)
Failed to configure openssl. It will not be installed.
Cheers,
Jan
On 28.02.2013, at 09:56, “Carlo E. Prelz” [email protected] wrote:
Please use another openssl. (e.g. using `configure
–with-openssl-dir=/path/to/openssl’)
Failed to configure openssl. It will not be installed.
Only? If so, your ruby source must be damaged. There should be a lot of
other stuff in the file.
It is from ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.bz2
and ruby compiles and runs from this source (though with out openssl).
But I think I got it working eventually:
Reading the suggestions and linked discussions the the others have
provided, I gave the --with-openssl-dir flag another chance (as it seems
still to be used despite of the warning). Now I tried different path
variants to point to my new openssl install. It seems so succeed when
using the dir above the openssl bin dir. Previously I only tried the
path to the binary and the path to its containing dir:
ls /Users/me/bin/openssl-1.0.1e-bin
bin include lib ssl
cd ruby-2.0.0-p0-src
./configure --with-openssl-dir=/Users/me/bin/openssl-1.0.1e-bin
–prefix=/Users/me/bin/ruby-2.0.0-p0-bin
make install
and now I could install gems with e.g.
gem install terminal-notifier
So I guess the openssl stuff is configured fine now.
Cheers and many thanks to all for the very useful input!
Jan H.