5 ms·
RVM 2.0: Convert 20,000 lines of shell script into Ruby [Fundraiser]
- moe 13y agoRvm is still around? I switched to rbenv years ago, never looked back.
- eaurouge 13y agoI'm sorry, but why shouldn't RVM still be around? Did it suddenly become obsolete the minute you switched to rbenv?
- bobbyi_settv 13y agoRVM shouldn't still be around because of its user-hostile behavior of modifying the user's dotfiles (.bashrc, etc.) on installation without warning or permission. This breaks other software in confusing ways. For example, I've had cases where after installing it, I could not view man pages for any programs because installing RVM modified broke my $MANPATH. In other cases, things that were failing for other reasons started producing confusing errors due to RVM doing sketchy things like replacing cd with a shell function.
- FooBarWidget 13y ago> RVM shouldn't still be around because of its user-hostile behavior of modifying the user's dotfiles (.bashrc, etc.) on installation without warning or permission. RVM tells the user very clearly that it has modified the user's dotfiles. And how many people do not want to modify the dotfile? Which user thinks, "oooh, modifying dotfiles is so evil, I'll just type in this command every single time I open a terminal"? At the end of the day, RVM just inserts a few lines to the dotfiles. What's the problem with that? Actually, chruby does not modify my dotfile for me, and I thought that modifying the dotfile is optional. I figured I'll just manually source chruby.sh every time I want to use it, just to experience how it's like. And then I ran into issues like this: https://github.com/postmodern/chruby/issues/213 https://github.com/postmodern/chruby/issues/213 Thanks but no thanks. I'd rather have the software modify my dotfile so that it can give me a pleasant user experience. > For example, I've had cases where after installing it, I could not view man pages for any programs because installing RVM modified broke my $MANPATH. In other cases, things that were failing for other reasons started producing confusing errors due to RVM doing sketchy things like replacing cd with a shell function. Never seen these problems before. Have you reported these problems? Have they been fixed in the latest version? If these problems are fixable then why throw the baby out with the bath water? As for replacing cd with a shell function: it's because it's one of the few ways auto-switching can be implemented. They found in a user survey that 80% of the users want auto-switching, so who are they to say "no" to their users? What problems have you experienced because of this? chruby's auto.sh implements the same functionality by installing itself into the shell's DEBUG hook... but is that really any better?
- bobbyi_settv 13y ago> Have they been fixed in the latest version? I don't know. I don't use Ruby or RVM anymore. > Which user thinks, "oooh, modifying dotfiles is so evil, I'll just type in this command every single time I open a terminal"? I did. And it's not "every single time I open a terminal", it's "the once in a blue moon that I need to work on a legacy Rails app". > They found in a user survey that 80% of the users want auto-switching Obviously people who choose to use RVM are going to be people who like the way that RVM operates. > If these problems are fixable then why throw the baby out with the bath water? The bath water is the specific bugs I ran into. As you say, those may fixed and aren't the point. The baby is the general practice of automatically injecting things into dotfiles and messing with shell builtins. We should throw that away because when it fails, it leads to "spooky action at a distance" bugs that are hard to understand and that break totally unrelated things (the user is in a shell session where they aren't doing anything related to Ruby).
- warmwaffles 13y agoI tried switching to rbenv, but I kept getting frustrated with the process.
- FooBarWidget 13y agoAnd this is exactly the problem with all those "simpler" alternatives to RVM. They all claim to be simpler and doing less "unnecessary" stuff. And they are simpler, from a technical point of view. But unless you, the user, is very skilled at Unix and knows exactly how environment variables, shell sessions, bashrc etc works, it's going to be more confusing. RVM is more complicated because it does more, in order to make it easier for users. Notice that most of the people who like rbenv/chruby are exactly the kind of people who are already intimately familiar with the Unix environment. I write C++ for a living and use the command line daily. Last time I used rbenv, I quickly gave up because I had to manually mess with $PATH, bashrc and other stuff that RVM always took care for me. I know how that stuff works, but the whole point of tools is to make my life easier. If I have to do so much stuff manually then why should I use rbenv? Back to RVM for me.
- bobbyi_settv 13y agoThe fact that RVM "does more" means that users need to understand more in order to fix problems that it causes. If you install RVM and other things on your system break due to its tampering with .bashrc, you need to understand what it has done. If I didn't understand $PATHs, etc., I would still be unable to use "man" due to $MANPATH being broken from the last time I installed RVM.
- FooBarWidget 13y agoCorrect, but it also means that the authors take responsibility for fixing those problems. That's the attitude we have for Phusion Passenger: it does a lot of stuff for you so that you don't have to. And if things break because of our fault, we take the responsibility of fixing it so you don't have to and can concentrate on your own business. Have the RVM authors not fixed the problems you experienced?
- sergiotapia 13y agoWhat's the difference, I'm curious. I learned RVM way back when, and haven't had the need to switch to be honest, but would love to learn.
- tvon 13y agoI suspect there is a lot of actively developed software out there that you do not use.
- khoury 13y ago$50.000? I don't get the amount of cash needed. Not judging, just not understanding. Could someone explain and justify the need for this?
- tinco 13y agoIs not a crazy amount, you have to take into account that it will probably be a year or more before this port is even close to done. And then take into account the years of support he will probably offer. That's not even thinking about all of the service they've provided to our community already. I would argue it's on the low side, I sincerely hope he'll go over it.
- reedlaw 13y agoThe number that got my attention was 20,000. That really seems extreme. What about the 40-liner Oh My Gems![1] And I wonder about the performance implications of porting all that shell script to ruby. Even running a single ruby command with a large set of gems increases loading time dramatically.[2] 1. http://blog.zenspider.com/blog/2012/09/ohmygems.html http://blog.zenspider.com/blog/2012/09/ohmygems.html 2. https://twitter.com/garybernhardt/status/388758868559290368 https://twitter.com/garybernhardt/status/388758868559290368
- carterparks 13y ago$100/hr x 500 hours = $50,0000 $100/hr is a very conservative estimate for an hourly rate for a senior level Ruby engineer that can read and understand shell code and implement clean, well documented code. 500 hours also seems very reasonable given that they'd be rewriting 20,000 lines of Bash. Not an easy task.
- mpapis 13y agoI plan on spending the next year working solely on RVM2, the fundraiser is updated with milestones => https://www.bountysource.com/fundraisers/489-rvm-2-0 https://www.bountysource.com/fundraisers/489-rvm-2-0
- nbouscal 13y agoAlternatively, use <100 lines of shell script: https://github.com/postmodern/chruby https://github.com/postmodern/chruby
- darkchasma 13y agoSilly man, that wouldn't require $50,000.
- FooBarWidget 13y agoRVM is larger and does a whole lot more than chruby. For one, it's much more friendly to new users and doesn't suffer from usability problems like these: https://github.com/postmodern/chruby/issues/212 https://github.com/postmodern/chruby/issues/212 https://github.com/postmodern/chruby/issues/213 https://github.com/postmodern/chruby/issues/213
- nbouscal 13y agoRVM doesn't suffer from those specific usability problems, but it most certainly does suffer from usability problems. I've wasted many, many hours debugging issues caused by RVM. For the most part, those issues are because RVM is larger and does a whole lot more than chruby, and since switching I haven't once missed any of those extra features.
- scoot 13y agoOr even better, rbenv: https://github.com/sstephenson/rbenv https://github.com/sstephenson/rbenv
- unwind 13y agoHow does one write a page like that, without even trying to explain, in a single sentence, what "RVM" is? It surely wouldn't hurt? I assume that if you don't know (like me), you're not in the target audience of people willing to chip in to get the conversion done, but it still manages to frustrate me.
- bstar77 13y agoIt's definitely something only targeted to Ruby devs. If you use ruby, you know what RVM is. To answer your question, RVM is a version manager for Ruby. http://rvm.io/ http://rvm.io/
- mpapis 13y agoThanks for the feedback, I’ve updated the fundraiser description, it was so obvious to me what RVM is, it should be now clear what RVM does.
- davidroetzel 13y agoI would love to hear more about "leverage existing package management systems". I guess many people use rvm to install ruby and I always recommend newbies to try it out for that purpose. But recent criticisms of ruby made me wonder if that really is the right approach. Maybe it would be better to put more effort into creating top-notch packages for the major linux distros (and, say, homebrew). And to work with the distributions on the stable packages, while offering official repositories to get the latest versions. rvm could still play a role in this scenario as a tool to switch between versions, isolate gem installations and so on, offering a unified interface that hides the platform differences of the distros. I would certainly donate to such a cause.
- brohee 13y agoI don't know if creating top notch packages is too realistic, when the biggest difficulty with that is often the platform policy (e.g. insistence on separating documentation and runtime, even if it's more tightly coupled that it looks, having only one executable per package...) that is the biggest hurdle to overcome. The fact that no platform got it right for Perl, Python nor Ruby points to a huge difficulty...
- bobbyi_settv 13y agoPython works pretty well with system packages. Few people compile Python from source in the way that is common for Ruby. People do use pip/ virtualenv, but those are more the equivalent of bundler/ RVM gemsets-- they manage libraries, not entire interpreters. It's a little confusing because virtualenv appears to have its "own" Python, but really it is a symlink to the (usually) system interpreter managed by the distro. The major distros have representatives who are active on python-dev in working out any issues that may make integration difficult between Python and the distros.
- Xylakant 13y ago> Python works pretty well with system packages. Does it? From my limited exposure to python I remember that e.g. recent CentOs comes with python 2.6 only and installing any never version requires you to manually compile it while being extra extra careful not to touch the system python since otherwise yum dies. Ruby works just well on that level - as long as the system ruby is fine for you, all is settled. For the rest of us that need a never/other ruby there's rvm/rbenv/chruby.
- nfoz 13y agoWhat is RVM?
- grogenaut 13y agoI would if RVM 1.0 didn't suck so much of my time away that I gave up and just went with vagrant.
- driverdan 13y agoUsing vagrant in place of rvm is like killing a housefly with a hammer. Vagrant is great if you want to setup the whole app environment but using it just for rvm's functions is overkill.
- grogenaut 13y agoyeah except try working on several projects where you have to use different rubies with different c libraries and compilers. RVM can't handle that. Vagrant can. rvm is like swatting at a housefly over and over and over and over and over and over and over and not killing it and nothing happening.
- anonymous 13y agoOr, they could just learn shell scripting. How much would that cost? I do not understand why the[1] shell... which is a relatively small language... is so difficult for people to learn. If you can find the time to learn Ruby, what stops you from learning a shell? What is the cost of ignoring it? 1. Preferably something resembling the proposed POSIX standard which might lend to portability. Bash is not necessarily the best choice unless every server you will ever use will be GNU userland/Linux kernel.
- mercurial 13y agoThat's precisely the kind of dismissive comment I needed to read today. You don't seem to have read the link, in which the author makes good points for moving to Ruby, or think that somebody maintaining 20k of complex shell script should actually "learn shell scripting". I'm sure the author is well-informed about shell scripting. While it's certainly convenient in a pitch, it has little support for unit-testing, error handling or other things which are extremely useful to ensure a robust codebase.
- anonymous 13y agoWell, since you seem to have insight as to the reasoning behind others' choices, perhaps you could enlighten us how someone came up with the idea of writing 20K lines of shell and passing it off to a community of Ruby developers as a "command line tool"?
- mercurial 13y agoInsight comes simply from having read the linked page. But at a guess, I'd say it comes from "let's do something small and simple in bash" combined with a bad case of incremental feature creep.
- lightningstorm 13y agoWhy we need rvm to install databases etc. when there is homebrew?
- SmileyKeith 13y agoI think I'm missing something. If an operating system doesn't come with a version of Ruby installed at all, how would you run RVM if it was written in Ruby? Unless it came bundled with a version of Ruby, which sounds bad. I thought the entire point of having these systems written in bash was to make them usable _before_ having Ruby installed at all?
- SmileyKeith 13y agoAfter thinking about this for more than 1 second I guess a large portion of RVM that works after you have Ruby installed, such as rvmsudo, could be based on Ruby. Leaving the setup code written in Bash.
- bradleyland 13y agoThere's a Google Doc with a lot more detail as well: https://docs.google.com/document/d/1xW9GeEpLOWPcddDg_hOPvK4oeLxJmU3Q5FiCNT7nTAc/edit?pli=1 https://docs.google.com/document/d/1xW9GeEpLOWPcddDg_hOPvK4o... Your question is covered under "Bootstrapping" > Bootstrapping > Using ruby should be possible thanks to binary rubies, in worst case we can fallback to static build or use JRuby. The binary Ruby (or static or JRuby) will be installed along with RVM 2 using very simple bootstrapping script written in shell most likely pure SH to provide compatibility with as much systems as possible I had similar thoughts. The fact that RVM is implemented (currently) in shell means you don't need Ruby installed. It does, however, expose your tool to all the idiosyncrasies of someone else's shell environment. I sit in #rvm on Freenode from time to time and the vast majority of trouble pings are related to differences in environment. That is to say, if you run a standard (as in, not heavily customized) environment, you won't have much trouble. There are a large number of users who really like to tweak their shell though, so RVM has to face the issue head on. I think this is what has lead the team to the "bundled" approach. It sounds like RVM 2.0 will be a full-blown application, rather than a collection of scripts. The choice to build the application in Ruby, as opposed to something like C, seems obvious when you consider what it is. Ruby folks want to write Ruby.
- SmileyKeith 13y ago
- happypeter 13y agoRVM is already doing too much, and trying to do more. Sure there is no looking-back since I switched to rbenv a year ago. And yes, so now I need to install ruby in order to install ruby?!