You say you have Ruby 2.2.0 installed, but looking at the error all of the references are for /Library/Ruby/Gems/1.8/gems/
which means SoundCloud 2000 is installed as a Ruby 1.8 GEM. So my guess is however you installed Ruby 2.2.0 that is not the main ruby
you are running from the command line. You can confirm with version of Ruby you are running on your Mac by running this command:
ruby -v
The output should be something like this; note on I am running Mac OS X 10.9.5 so my installed version of Ruby will be higher than Mac OS X 10.8.5:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
You can also see where your version of Ruby is being loaded from via which
like this:
which ruby
The output should be something like this:
/usr/bin/ruby
The which
tool tells you exactly what path the binary you are calling via that command is being loaded from.
Since it seems like you are using Homebrew to install a newer version of Rub, you need to also make sure your user’s $PATH
is set to check /usr/local/bin
before checking /usr/bin
. This is typically set in the .bash_profile
file in your home directory which is located via ~/.bash_profile
. Just note that this stuff might also be set in a file named .bashc
, so adjust the examples to use .bashc
instead of .bash_profile
if that is the case.
For example, if I run the following command on my Mac OS X setup:
cat ~/.bash_profile
I see these contents:
export PATH="/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/opt/ImageMagick/bin"
Might look complex, but it isn’t. All that command does is basically set the $PATH
settings for your shell environment. And the items between the quotes are just directory paths separated by :
characters. Of note to you this the order of /usr/bin
versus /usr/local/bin
; one comes in front of the other. Which basically means the system will check for ruby
in /usr/bin
and prefer to use that one before it even reaches the ruby
installed via /usr/local/bin
. So a quick fix for you would be to take /usr/local/bin
and place it in front of /usr/bin
via a text editor like nano
. Then save it, exit your Terminal session and open a new one.
That said, if I were you I would recommend avoiding system level Ruby and Ruby GEM installs via Homebrew and rather use RVM (Ruby Version Manager) instead. Ruby—and Ruby GEMs—can actually be a pain to deal with on a good day; and even a worse of a headache on a Mac. So using RVM instead can allow you to create isolated Ruby and Ruby GEM installs specific to your user that are easier to manage.
I do Linux systems administration and tend to want to upgrade the version of Ruby installed by default and used to do that via source or package installers. But the more work I do on Ruby setups, the more I’ve realized that RVM is really the best way to install, manage and deal with Ruby setups. Slight learning/understanding curve when you first set it up but past that it will make your life—and system management—tons easier.