开发者

how do i make a library installation available to different rubies

开发者 https://www.devze.com 2023-03-13 09:16 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号