gem install of pdf-extract on Macports / Mac OS X Yosemite - ruby

I am attempting to install pdf-extract on Mac OS X Yosemite. I assume it's better not to use the /usr/bin/ruby that comes with Yosemite, so I'm using the Macports version, /opt/local/bin/ruby (ver2.1.3).
The installation appears to go fine:
sudo port install ruby
sudo port install rb-rubygems
sudo port select --set ruby ruby21
which ruby #/opt/local/bin/ruby
which gem #/opt/local/bin/gem
sudo gem install pdf-extract
At the end of the last command, the message appears to indicate that all went well:
...
Done installing documentation for Ascii85, afm, commander, hashery, highline, libsvm-ruby-swig, mini_portile, nokogiri, pdf-core, pdf-extract, pdf-reader, prawn, ruby-rc4, sqlite3, ttfunk after 30 seconds
15 gems installed
However, when I attempt to run pdf-extract, I ran into the following error:
$ cd bin/
$ ./pdf-extract extract --titles journal.pdf
/opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:384:in `block in require_program': program version required (Commander::Runner::CommandError)
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `each'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `require_program'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:51:in `run!'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/import.rb:10:in `block in <top (required)>'
/private/tmp/pdfextract/lib/pdf/extract/references/score.rb:11:in `<module:Score>': uninitialized constant Libsvm::Model (NameError)
from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:4:in `<module:PdfExtract>'
from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:3:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `require_relative'
from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `require_relative'
from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `require_relative'
from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `<top (required)>'
from ./pdf-extract:5:in `require_relative'
from ./pdf-extract:5:in `<main>'
My question is whether I've done the gem install correctly (and therefore it's probably a bug in pdf-extract) or whether I've messed up something in the installation (or in the file paths).
Side note: the installation folder was initially $HOME/Dropbox/code/ruby/pdf-extract, but I carried out a mv pdf-extract /tmp (to shorten the file paths in the error messages) and re-ran the install scripts (the error message essentially remained the same). I also tried replacing ./pdf-extract with /opt/local/bin/ruby2.1 pdf-extract but it did not help.

Related

"uninitialized constant OpenSSL::PKey::EC" from Ruby on CentOS 6.6

I have a Rails server application that uses the openid_connect gem. When I attempt to run it on CentOS 6.6, I get:
uninitialized constant OpenSSL::PKey::EC
Here is the full stacktrace:
$ rails server
/home/foo/.rvm/gems/ruby-2.1.3/gems/json-jwt-1.5.1/lib/json/jwk/jwkizable.rb:69:in `<top (required)>': uninitialized constant OpenSSL::PKey::EC (NameError)
from /home/foo/.rvm/gems/ruby-2.1.3/gems/json-jwt-1.5.1/lib/json/jwt.rb:102:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object/id_token.rb:1:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:7:in `block in <top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:6:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/response_object.rb:6:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect/connect_object.rb:52:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/openid_connect-0.9.2/lib/openid_connect.rb:85:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /home/foo/tmp/openid_connect_sample/config/application.rb:7:in `<top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:53:in `require'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:50:in `tap'
from /home/foo/.rvm/gems/ruby-2.1.3/gems/railties-3.2.22/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
What does this mean and how I can I get past it?
This problem stems from Red Hat's refusal to include (for fear-of-patent-litigation reasons) certain Elliptic Curve (EC) algorithms in CentOS' default build of OpenSSL.
Note: According to #Cal's answer, CentOS 6.7 does not have this issue.
The openid_connect gem is dependent on the json-jwt gem, which uses one of those not-included algorithms.
Therefore, you need to rebuild a new version of OpenSSL that includes the needed algorithms.
These are the steps I followed (adapted from here) to build a new OpenSSL on my machine:
cd /usr/src
wget https://www.openssl.org/source/openssl-1.0.1l.tar.gz
yum install autoconf automake (you probably already have these installed)
tar zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
export CFLAGS="-fPIC"
./config --prefix=/opt/openssl shared enable-ec enable-ecdh enable-ecdsa
make all
make install
Now, your Ruby is probably still linked against the old OpenSSL library, so you'll need to rebuild it to link to the new one.
Are you using rvm? Then great! Any new Rubies you install will build against the new OpenSSL. rvm remove your Ruby and re-install it (or simply install a different ruby version).
Not using rvm? Then I guess you'll need to rebuild Ruby the traditional way. But you probably already know how to do that, right? If not, you'll need to look in a different tutorial, because we can't cover that here.
Now reinstall bunder and do a bundle install, and your rails server should now run successfully.
(If anyone has corrections or clarifications to offer, please leave a comment and I'll make edits as necessary.)
I ran into this same problem with CentOS 6.6. But I didn't want to recompile a custom openssl and ruby to fix this. I didn't take very good notes because I tried so many things, but it appears that an update to all of the latest & greatest packages to CentOS 6.7 solves the problem.
Here are a few relevant package versions I have:
openssl098e-0.9.8e-18.el6_5.2.x86_64
openssl-1.0.1e-42.el6.x86_64
openssl-1.0.1e-42.el6.i686
openssl-devel-1.0.1e-42.el6.x86_64
glibc-2.12-1.166.el6_7.3.x86_64
kernel-2.6.32-573.7.1.el6.x86_64
After updating these packages, rebooting, and reinstalling my bundle the json-jwt gem worked perfectly.
This was our production machines, and I believe the ruby standard libs were compiled from source, then created as a custom RPM.
Our build server uses RVM, and this ended up being more of a pain. The RVM installer kept pulling binaries for centos, and the same failure came back again.
Found remote file https://rvm.io/binaries/centos/6/x86_64/ruby-1.9.3-p484.tar.bz2
I forced a source recompile like this:
rvm reinstall --disable-binary ruby-1.9.3-p484
And I noticed a very wonderful looking message:
#applying patch .rvm/patches/ruby/ssl_no_ec2m.patch.
That patch file has some C macro conditions that appear to exclude some EC related code.
And that worked! I also noticed that ruby's openssl.so has a lot of EC related symbols in it. The previously packaged centos ruby did not have these:
$ cd ~/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-linux
$ strings openssl.so |grep _EC
PEM_write_bio_ECPKParameters
i2d_ECPKParameters
PEM_read_bio_ECPKParameters
d2i_ECPKParameters
PEM_write_bio_ECPrivateKey
i2d_ECPrivateKey_bio
i2d_EC_PUBKEY_bio
PEM_write_bio_EC_PUBKEY
PEM_read_bio_ECPrivateKey
PEM_read_bio_EC_PUBKEY
d2i_ECPrivateKey_bio
d2i_EC_PUBKEY_bio
OPENSSL_1.0.1_EC
EVP_PKEY_assign_EC_KEY
OP_SINGLE_ECDH_USE
If I had to guess, the recompile against my new openssl 1.0.1 package must have triggered some C macros that opened up some kind of alternative algorithm that isn't legally protected.
If you check your openssl.so for symbols and it doesn't have all of these _EC related stuff, that's probably an issue.

compass installation does not work anymore

Using Mac Mountain Lion
My compass installation does not work any more
I used brew, rvm, gem sometimes together with sudo (yes meanwhile I know this was not a good idea) - I have to admit that I do not have a clear picture which parts of rvm could conflict with the native ruby installation or with installations from brew…
compass install compass
gives me:
$ compass install compass
/Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- sass/script/node (LoadError)
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in <top (required)>'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:inblock in '
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in each'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in <top (required)>'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:inblock in '
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in each'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Users/marc/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in block in <top (required)>'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:infallback_load_path'
from /Users/marc/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in <top (required)>'
from /Users/marc/.rvm/gems/ruby-2.1.0/bin/compass:23:inload'
from /Users/marc/.rvm/gems/ruby-2.1.0/bin/compass:23:in <main>'
from /Users/marc/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:ineval'
from /Users/marc/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `'
then
which -a gem
results in:
/Users/marc/.rvm/rubies/ruby-2.1.0/bin/gem
/usr/local/bin/gem
/usr/bin/gem
/usr/local/bin/gem
/usr/bin/gem
After I learned today that I should not use sudo when installing sass and compass I deinstalled sass and compass using sudo. Following that I did a gem install compass without sudo.
Unfortunately same error as above.
So this does not have an impact.
Any ideas?
Thanks,
Marc
Has been solved by this entry.
Have gone back to an earlier Sass version and everything is fine.

Can't use compass after installing it

I don't seem to be able to get compass working on Vagrant using this Vagrantfile. See the rest of the bash script's used right here(removed repo) (see Vaprobash if you want to provision your Vagrant Ubuntu Box!).
So I was fallowing a gruntjs course, when I had to use grunt server. The only problem is that it needs a newer ruby version (1.9+ I believe instead of the 1.8) and it needs compass. So I have solved the ruby part by installing RVM and installing the latest stable version. Compass should be easy to get gem install compass and it does seem to be installed. But when I type in compass -v I get the fallowing error:
/home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError)
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `load'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `<main>'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
So I am not sure what is going wrong except for the error telling me it's missing files. Anyone got some hints to what could be the problem?
.bash_profile contains the path info:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
rvm -v and ruby -v work just fine and after installing gem install compass sass -v seem to work as well.
You can replicate everything using Vagrant and VirtualBox. Just download the Vagrantfile from my github mentioned above and vagrant up.
I asked for help on the official compass Github issue's page and got the answer for this problem.
The GitHub issue is right here.
How to fix this:
When installing compass (v0.12.2), it will download the latest sass v3.3.0.rc3 (cause it's a dependency), but compass won't work with the latest sass. You either upgrade compass to the latest alpha version (0.13.*) or downgrade sass to 3.2.*. I choose the last one:
gem uninstall sass --version 3.3.0.rc.3
gem install sass --version 3.2.18
compass -v # Working :)
Make sure you use the version you got installed. Find out by typing this:
sass --version
have a look at this answer https://stackoverflow.com/a/21082978/497756 - it was for other problem but should solve yours too.

Why does Rails console say "cannot load such file -- readline"?

I am new to Ruby on Rails, and am using RVM to manage Ruby versions.
My laptop has Ruby1.8.7 installed, but my project is using RVM, Ruby1.9.3 and Rails 3.2.11.
I can't run rails c or rails console without it giving me the following error:
/home/phil/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /home/phil/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/phil/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands/console.rb:3:in `require'
from /home/phil/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/phil/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands.rb:38:in `require'
from /home/phil/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.11/lib/rails/commands.rb:38:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
You need to have the readline libraries installed when you compile Ruby.
If you are on CentOS/Redhat/Fedora Linux, install the package using:
sudo yum install readline-devel
Or, on Ubuntu, use:
sudo apt-get install libreadline6 libreadline6-dev
and then recompile Ruby.

How to install ruby(rubygems) with openssl?

When running rvm rubygems latest I get the error.
How fix it?
Error running 'env GEM_PATH=/Users/sjc/.rvm/gems/ruby-2.0.0-p0:/Users/
sjc/.rvm/gems/ruby-2.0.0-p0#global:/Users/sjc/.rvm/gems/ruby-2.0.0-p0:
/Users/sjc/.rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/Users/sjc/.rvm/gem
s/ruby-2.0.0-p0 /Users/sjc/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /Users/s
jc/.rvm/src/rubygems-2.0.0/setup.rb', please read /Users/sjc/.rvm/log/
ruby-2.0.0-p0/rubygems.install.log
The log (rubygems.install.log) has this:
[2013-03-05 20:31:37] /Users/sjc/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
/Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError)
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/security.rb:8:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/package.rb:43:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/installer.rb:8:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/request_set.rb:5:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems.rb:195:in `finish_resolve'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/rdoc.rb:14:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/uninstaller.rb:10:in `<top (required)>'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:440:in `uninstall_old_gemcutter'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:144:in `execute'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command.rb:305:in `invoke_with_build_args'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:170:in `process_args'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:130:in `run'
from /Users/sjc/.rvm/src/rubygems-2.0.0/lib/rubygems/gem_runner.rb:60:in `run'
from setup.rb:45:in `<main>'
RubyGems 2.0.0 installed
Because I didn't know what I was doing, I think my earlier attempt at installing sass may have caused this. I followed these instructions, thus doing these commands earlier in the day.
$ export GEM_HOME=/home/mygemrepository
$ ruby setup.rb --prefix=/home/mystuff
Again, I don't if that matters as GEM_HOME and GEM_PATH seem correct.
$ echo $GEM_HOME
/Users/sjc/.rvm/gems/ruby-2.0.0-p0
$ echo $GEM_PATH
/Users/sjc/.rvm/gems/ruby-2.0.0-p0:/Users/sjc/.rvm/gems/ruby-2.0.0-p0#global
Looks like you're missing openssl. Checkout: https://rvm.io/packages/openssl/
Examples for ruby 2.3.1, or may be other version of ruby.
Without reinstall rvm:
rvm pkg install openssl
rvm install 2.3.1 --with-openssl-dir=$HOME/.rvm/usr
Or with reinstall rvm:
rvm implode
\curl -sSL https://get.rvm.io | bash
rvm pkg install openssl
rvm install 2.3.1 --with-openssl-dir=$HOME/.rvm/usr
Or with custom rubygems for ruby < 2.3:
rvm pkg install openssl
rvm install 2.2.2 --rubygems 2.7.10 --with-openssl-dir=$HOME/.rvm/usr
PS: after all may be reinstall all ruby versions
rvm reinstall all --force
Another possible issue is if your default version of Ruby is old.
Most OS come preinstalled with Ruby, but use an older versions of Ruby (1.8.x), rather than 2.x or even 1.9.x and that may cause the new version of rvm to fail.
$ rvm list
to see the list of ruby versions install, and use ("ruby use uby-1.9.3-p429" equivalent ) to set that and then try :
$ rvm get stable
(get the most recent bugfixes and ruby version updates )
$ rvm rubygems latest
I also changed the default ruby :
$ rvm --default use 1.9.2
worked for me!

Resources