Hacker News new | ask | show | jobs
by mhansen 5356 days ago
Monkey patching in ruby has well-known problems (what happens when two libraries patch the same object?), and now good library maintainers know not to monkey-patch standard libraries. Neither should RVM.

The monkey-patching of `cd` is the main reason I'm not using RVM. I depend on `cd` to work, every time, rock solid, especially when my system is unstable. I can't risk having a dependency or bug in their `cd` script breaking my most commonly used shell command.

rbenv has demonstrated that it's not necessary to override `cd` to manage ruby versions, so why does RVM still do it?

2 comments

The only function of RVM that requires overriding `cd` is the autoloading of .rvmrc, which is easily turned off with a single line of configuration. The topic is so beaten to death that we've even been through one iteration where RVM turned it off by default.

Here's the rub. No one ever has a problem with the overridden `cd` command. Community outcry resulted in a reversion of the default returning to it's original configuration.

What bugs the shit out of me is the band-wagoning from people who, frankly, haven't got a clue. They hear that "there be dragons" in RVM, and all of the sudden everyone is running around flailing their hands over their head like RVM installs a custom kernel or something. It's unwarranted, and it all stems from the original hit job pulled by Sam Stephenson when he released rbenv. Meanwhile, all the same people who are screaming about the "magic" in RVM were cluelessly using it for god knows how long before rbenv came along.

Sam has since apologized and will tell you that RVM is a fine tool, but everyone seems to have forgotten that. If you don't want to use RVM, fine, don't use it, but the "reasons" everyone cites for avoiding it are pretty weak in practice. Wayne is one of the strongest bash programmers I've ever seen. I trust him, and every time I've needed him, he's been available in #rvm for help. Go forth and use rbenv, but you don't have to kick dirt on RVM along the way.

Can you explain to me how did RVM cause cd to interfere with your work experience? Im curious because Ive been using it forever and other than it executing my .rvmrc files, havent noticed a bit of difference
RVM's overriding of cd isn't portable to other shells. I can't use it in my favourite shell (fish).

Yeah, there's http://beginrescueend.com/integration/fish/, but I tried that and it started printing errors every time I used cd due to some bug (this was over a year ago, there's a good chance it's been fixed, but it just left me really shy about overriding cd).