Skip to content

Instantly share code, notes, and snippets.

@danwoolley
Last active December 14, 2015 08:29
Show Gist options
  • Save danwoolley/5058463 to your computer and use it in GitHub Desktop.
Save danwoolley/5058463 to your computer and use it in GitHub Desktop.
Installing librets on OSX Mountain Lion with rvm
# On OSX Mountain Lion, 'brew install librets' installs librets into the system ruby folder,
# not the current rvm ruby as it used to on older versions of OSX. The only work-around I've
# found is to take the librets.rb and librets_native.bundle files and copy them into the proper
# rvm ruby's folders.
# Best way - make desired version of ruby the system ruby.
rvm use system
which ruby
# return the current system version of ruby
ls -l /usr/bin/ruby
# link system ruby to desired ruby
ln -s /Users/Dan/.rvm/rubies/ruby-1.9.3-p286-falcon/bin/ruby /usr/bin/ruby
rvm use system
which ruby
# should be desired version of ruby
# Now install librets - should install for desired version of ruby
brew tap homebrew/boneyard
brew install librets
# Alternative way - copy the librets files into proper folders for the desired version of ruby.
# Set rvm ruby version and install librets
$ rvm use ruby-1.9.2-p290
$ brew install librets
# Check to see if it worked
$ irb
> require 'librets'
Error
# Find librets.rb file. This is where it was on my system, but on others it will be in their system ruby folder
$ find ~/.rvm/rubies -name 'librets.rb'
~/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/librets.rb
~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/librets.rb
# Find librets_native.bundle. This is where it was on my system, but on others it will be in their system ruby folder
$ find ~/.rvm/rubies -name 'librets_native*'
~/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/i686-darwin11.3.0/librets_native.bundle
~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.3.0/librets_native.bundle
# Copy librets.rb to different rvm ruby path
$ cp ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/librets.rb ~/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1
# Copy librets_native.bundle to different rvm ruby path
# Note the different darwin sub-folder for this version
$ cp ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.3.0/librets_native.bundle ~/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/x86_64-darwin12.2.0/
# Check to see if it works
$ rvm use ruby-1.9.2-p290
$ irb
> require 'librets'
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment