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?
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: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 06:32:24 +0900
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
I have spent the last couple of days struggling 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 our 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.
UPDATE: Ok, I finally got Ruby 2.0 to compile and install successfully.
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.
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
How about, instead of having every single person who wants to install
ruby and gems on OSX have to jump through this stupid series of
ridiculous hoops, the relatively few ruby DEVELOPERS actually fix the
build configuration (for OS X and others as well)? The man-hours spent
this way are all upside down. Fix it at the head, not at the tail. This
kind of hopeless head-banging by all of us is an idiotic expectation.
The fact that "--with-openssl-dir" apparently throws meaningless errors
(or are they meaningful, and how the hell are we supposed to know?)
proves that ruby devs aren't minding the store.
Someone(s) who _understand(s)_ the "configure" and "automake" setup
should actually provide documentation for --with-openssl-dir and
--with-out-tcl and --with-out-tk and the dozens of other parameters that
cause lots of errors that the build plows right through. Use these
parameters at all and have the system bark at you. And expect them to
have no effect as well, in my experience.
A ruby USER shouldn't have to know everything that the ruby DEVS do, but
we are getting closer to it with every release. This is only one more
thing to really make it a pain in the neck for every OSX ruby user out
here. It almost feels like ruby devs want to make ruby such a pain to
build or install that the rest of us will give up on it.
Better yet, Apple, how about releasing ruby 2.0 with your next iteration
of OS X? OK, now I'm obviously hallucinating.
Subject: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 06:32:24 +0900
Quoting Dr. Hegewald (hegewald@irmb.tu-bs.de):
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
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
···
On 27.02.2013, at 10:45, Carlo E. Prelz <fluido@fluido.as> wrote:
Use ruby-build to install 2.0.0-p0. It'll handle the OpenSSL setup.
···
On Wed, Feb 27, 2013 at 12:09 PM, guillermo haas-thompson <lists@ruby-forum.com> 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.
), 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
···
Subject: Re: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 07:18:50 +0900
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
On 27.02.2013, at 11:18, "Dr. Hegewald" <hegewald@irmb.tu-bs.de> 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:
On Wed, Feb 27, 2013 at 12:09 PM, guillermo haas-thompson > <lists@ruby-forum.com> 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.
I have been reading around and it looks like there were still problems
even when using ruby-build
(https://github.com/sstephenson/ruby-build/issues/305\) 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.
), 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
···
On 27.02.2013, at 11:45, "Carlo E. Prelz" <fluido@fluido.as> wrote:
> 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:
1)
mkdir -p /path/to/install
2) (from the source of openssl)
./Configure darwin64-x86_64-cc --prefix=/path/to/install --openssldir=/path/to/install/openssl/
make
make install
3) (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 07:58:37 +0900
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
Subject: Re: Mac OS 10.8.2 and openssl
Date: mer 27 feb 13 07:58:37 +0900
Quoting Dr. Hegewald (hegewald@irmb.tu-bs.de):
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.
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.
3) (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 Hegewald
···
On 27.02.2013, at 14:33, "Carlo E. Prelz" <fluido@fluido.as> wrote: