Search code examples
macosrbenv

Installing a gem on Mac OSX with new Ruby Version


I have Mac OSX with Ruby default 1.8.* installed.

I would like to install the following gem: https://github.com/jfahrenkrug/WWDC-Downloader

When initialling trying to install this I got an error: Error installing wwdcdownloader: nokogiri requires Ruby version >= 1.9.2.

I then looked around and found this SO question about using rbenv. How to update Ruby to 1.9.x on Mac?

I have now installed rbenv - https://github.com/sstephenson/rbenv/ also installed ruby-1.9.3-p327

However, when I try to install the gem wwdc (from top) I get an error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

So how do I tell terminal to install using this latest ruby version?

EDIT ----- The gem installation is now complete Successfully installed wwdcdownloader-20.13.5 14 gems installed

However, when I run the next command in terminal from here ( https://github.com/jfahrenkrug/WWDC-Downloader) I get another error: -bash: wwdcdownloader: command not found??


Solution

  • It looks like you haven't told rbenv you want to use the new ruby, with either

    rbenv global {version}
    

    or

    rbenv local {version}