开发者

What are the advantages of RVM on linux?

Please understand that I'm not trying to bash RVM. I would just like to understand why it's so popular in the Ruby community.

There appears to be two main reasons to use RVM - to manage/switch between different versions of Ruby, and to manage a specific gemset per project. However there seem to be much cleaner ways of achieving the same thing on linux:

  • I can install different ruby versions from the repositories through the regular package manager, or build from source and install as a package. I can switch between versions using update-alternatives (on Debian, Ubuntu, Fedora at least).
  • I can use Bundler to manage sets of gems for different projects, as outlined in this blog post.

Given the above, I'm confused as to why I would want to use RVM to manage Ruby versions and gems. The idea of using 开发者_JS百科a bash script to install software on my system outside the package manager feels very hackish, a feeling backed up by this blog post.

Not being a Mac user I am totally guessing here, but I thought it might be that OS X is very popular in the Ruby community. If there is no system like update-alternatives for switching ruby versions on OS X, RVM might be the best solution and this idea has carried over to linux too.. like I said, this is just a guess.

So why is RVM so popular, and why should I prefer it over the regular package manager + Bundler on Debian or Ubuntu?


If you need to manage many project with diferent versions of Ruby and special Rails like me (I have 3 project to manage wich uses Rails 2.3.5, Rails 3.0.5 and Rails 3.1 rc1) do RVM is nessesary solution. As you may know Rails 2.3.x has no bundler support and uses old gems so version managing is the way to make developing easier. I hope I helped you alittle.


  1. RVM is portable
  2. update-alternatives works globally, RVM works in shell/script context - I suppose it is modyfying env paths. Now imagine having two apps on one server: one 1.8.7 and another 1.9.2
  3. Usage of Ruby EE requires manual installation - with RVM it is matter of one command to install it.
  4. I had too much problems with mixed gem dirs with 1.8.7 only or 1.9.2 only gems in Debian.
  5. Easy backup - just copy .rvm dir.
  6. Consistent clustering (same platform) - just share one .rvm dir.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜