I am attempting to install the librets library开发者_StackOverflow中文版. I can use rvm to switch to the system ruby (1.8.7) and install librets and it seems fine. I am then able to require librets. But then if I switch to ruby 1.9.2 with rvm and i try to require librets, it says no such file to load. So how do I install a library so it works across rubies. Or how do I install specific to each ruby so it works there. 1.9.2 is the version I need most.
FYI, librets is not a gem
For installing a library when using rvm, you can use rvm ruby-1.9.2 gem install librets
and that will install the library for the specific ruby version. However another neat alternative to achieve what you desire can be achieved using gemsets.
rvm use system
rvm gemset create librets
rvm gemset use librets
gem install librets
rvm use ruby-1.9.2
rvm gemset create librets
rvm getset copy ruby-1.8.7@librets ruby-1.9.2@librets
rvm gemset use librets
Although I believe the above is a little too cumbersome when you want only 1 particular gem, but if it is a series of gems that you want, copying gemsets can be a big time saver.
It appears you can use my_use_ruby=yes
https://gist.github.com/977074#gistcomment-36462
精彩评论