12 ms·
Rbenv, an unobtrusive rvm replacement
- bonzoesc 15y agoIt would be somewhat cool if ruby-build knew how to look for an rbenv folder to install rubies into, or if rbenv knew how to drive ruby-build to put rubies in the right directory, but otherwise it's pretty nice.
- sstephenson 15y agoThat's a good idea... ruby-build could provide an `rbenv-install` plugin command for rbenv.
- stock_toaster 15y agoruby-build seems fairly small. Have you considered just including it inside rbenv's bin directory? That may decrease the friction and improve the 'git checkout rbenv, add path, and get started' workflow.
- telemachos 15y agoIt is fairly small, but I think part of the idea is to decouple rbenv from how or with what tools you build Rubies. (It might make sense, though, for someone to create and maintain a fork that bundles ruby-build and rbenv.)
- sj26 15y agoI was just about to go an do this. Has anyone else yet?
- sj26 15y agohttps://github.com/sj26/rbenv-install https://github.com/sj26/rbenv-install
- NARKOZ 15y agoIs it production ready? RVM is.
- nwjsmith 15y agoThe project is only 10 days old (so, no). It looks promising though, especially as an alternative to RVM in development. I'm keen on installing something that doesn't take over my shell. I'm not going to lose sight of how awesome RVM is though. It changed the way I develop in Ruby.
- bonzoesc 15y agoI don't see a pressing need to use RVM in production; when I deploy, I pick a Ruby version and stick with it unless there's a security issue, at which point I pull the updated REE package from Phusion/let Heroku figure it out. Considering the many times I've seen RVM installs fail due to checked-in broken code, I'd hardly call it "production ready" either.
- nirvdrum 15y agoThe complete lack of a changelog doesn't help either. I never know whether something's going to break in a new release and almost every new release has some little semantic change that borks my system.
- xentronium 15y ago> I don't see a pressing need to use RVM in production 1. Gemset isolation comes in handy. 2. Sometimes you want to have multiple ruby versions (e.g. MRI for app and JRuby for memory heavy script)
- sstephenson 15y agoAn official release with a web site and improved installation process should be out next week. If you're wondering "why would I use this instead of rvm?" be sure to read the readme: https://github.com/sstephenson/rbenv#readme https://github.com/sstephenson/rbenv#readme
- grabastic 15y agoThis looks very, very promising. Great work. I've never liked how RVM overrides shell commands.
- stock_toaster 15y agoWow. Looks great. Definitely going to give this a spin. Thanks! :)
- yariang 15y agoI looked at RVM a few weeks back while trying to set up a Rails app and was so frustrated I went outside and kicked a kitty. I am glad to see a project that should restore some of my sanity. Good work.
- kaylarose 15y agoWhat was so frustrating about RVM?
- yariang 15y agoI just could not get it to work. I follow several instruction pages carefully. I was initially trying to follow: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:install_ruby http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#se... I kept getting issues with versions. I should have specified that, I do not necessarily think it is a bad product, but it did frustrate me a lot when trying to set it up. I'm sure it has saved a lot of developers time, but I speak for myself and myself alone, and the cost-benefit for me was way off.
- aneil 15y ago
- jarin 15y agoPretty nice, but I actually do really like having gemsets. It gets me as close to the production environment as possible, plus it makes it really easy to clean up unused gems when I'm done with a project.
- stephencelis 15y agoYou can use Bundler to isolate your gems locally, or you can use rbenv-gemset: https://github.com/jamis/rbenv-gemset https://github.com/jamis/rbenv-gemset
- nzadrozny 15y agoFor that, I use Bundler and always install gems to vendor/bundle for maximum isolation and easy cleanup. :~ which bi bi: aliased to bundle install --path vendor/bundle
- stephencelis 15y ago(You should only have to run this the first time you bundle.)
- mudgemeister 15y agoYou can tell Bundler to install to a relative path by default by putting the following in ~/.bundle/config: --- BUNDLE_PATH: vendor/bundle In that way, you need only run the standard "bundle" or "bundle install" instead of setting up an alias.
- hadis 15y agobut does this not increase the size of your source control repository?
- zszugyi 15y agoNo, just add the directory to .gitignore.
- cwjohnston 15y agoLooks interesting. It's always been pretty amazing to me that a system like RVM remains so popular when it depends on overriding the operation of basic commands like 'cd'.
- syncsynchalt 15y agofor anyone curious, compare to https://github.com/wayneeseguin/rvm/blob/master/scripts/cd https://github.com/wayneeseguin/rvm/blob/master/scripts/cd
- sanderjd 15y agoYeah it's a really interesting demonstration of something that is just so darn useful that you're crazy not to use it (on your development machine), regardless of your complaints with it.
- mhansen 15y agoThat's 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.
- hadis 15y agoSo then what did you use on your development machine to test your ruby apps with till now? What did you use if not RVM? I am happy that RVM exists and made my life as ruby developer much easier even if it overrides 'cd'. Also to note i never had problems with RVM. Your main reason not using RVM is poor, as if there were more options out there till now.
- boz666 15y ago.bash_profile? How hard is that? ruby==ruby 1.8.7 ruby9==ruby 1.9.2 jruby== jruby 1.6 jruby5==jruby 1.5 Yeah, real tough.
- aneil 15y ago
- revscat 15y agoThis looks promising because it looks like it will work seamlessly with tmux/screen, something rvm struggles with.
- lisperforlife 15y agoI never had a problem using RVM with tmux.
- axomhacker 15y agoWhat problems did you see using rvm with screen? I use that daily and haven't seen any problems so far.
- revscat 15y agoI am currently porting a Ruby application over to JRuby, and use tmux (although I am pretty sure screen would behave the same). Let's say you have two rubies installed, ree and jruby. You start out using ree, and are using screen/tmux, and have two screens open. If you switch to JRuby in the first screen, then switch to the second, the changes don't propagate. e.g.: (first screen) $ rvm list rvm rubies => jruby-1.6.3 [ darwin-i386-java ] ree-1.8.7.2001.03 [ x86_64] (second screen) $ rvm list rvm rubies jruby-1.6.3 [ darwin-i386-java ] => ree-1.8.7.2001.03 [ x86_64] It's not a big deal -- you just have to make sure you do the right thing -- but it is unexpected and has burned me a couple of times. It looks like rbenv won't suffer from this problem.
- chc 15y agoI'm having trouble imagining who this is for, at least in the context of an RVM replacement. The point of RVM is convenience. It's like RVM, only without most of the convenience (gemsets, installing standard versions and migrating between versions, primarily). If I wanted to manually manage all my Rubies, I wouldn't be using RVM. I like the sentiment of being less of a hack than RVM, but I just don't see much use for this particular set of functions
- sstephenson 15y agoThe main use case is for specifying per-application Ruby version dependencies. For example, at 37signals, most of our apps run on REE, but our new apps run on 1.9.x, and we're gradually moving everything to 1.9. When you have multiple people working on multiple apps every day, it's essential that this dependency information is checked into version control. Even more so when certain branches of an app may depend on different versions. Both rvm and rbenv allow you to specify per-application dependencies (rvm with .rvmrc files, rbenv with .rbenv-version files). The difference is that rbenv does it in a much simpler, less invasive way.
- deleted 15y ago[deleted]
- boz666 15y agoEvery other week something goes wrong with RVM. Nothing convenient about that.
- grimen 15y agoMakes sense, though I'll stick to RVM until I change my mind - RVM floats my boat, haven't had any serios issues and I live in the shell. Bad short-term (community confusion), good long-term (evolution of initial innovation). I'm very neutral here. I got a simple solution for all you distro vs RVM people: People who prefer to use RVM - use RVM, people who prefer to use distro - use distro. Until you have proven that a server that runs distro is 2x more valuable in $ - post on HN and we could review it again. Reminding you of that we don't live in a totally symmetric universe.
- bricestacey 15y agoI just uninstall rvm and install rbenv. It seems to work so far. I'm glad to switch. rvm confused the hell out of me.
- freedrull 15y agoYes RVM is a crazy hack, but that's why I love it! Has anyone actually had problems with RVM overriding 'cd'? Has RVM changed the behavior of 'cd' in a way that was a problem for you?
- gfxmonk 15y agoYes. I don't know if it was due to a weird environment variable or something, but when I installed RVM it got itself into an infinite loop sometimes when I did `cd`. I reported a bug, but the author couldn't reproduce or fix it. So now I recommend anyone who asks me not to use rvm, because it's utterly ridiculous.
- telemachos 15y ago> Has anyone actually had problems with RVM overriding 'cd'? I did, in two different ways. The first time, cd was returning the wrong exit status. (That is, it had become a function and was returning the exit status of its last command, rather than the exit status of the actual cd call. A common gotcha when you override shell built-ins or other commands.) The incorrect exit status caused a number of shell scripts completely unrelated to rvm to break. That made it harder to debug, obviously. The second time I had trouble, TAB autocompletion with cd was broken. At one point, rvm was doing its own autocompletion for cd, although the last time I looked, it no longer does that by default. (Yeah, just checked - that code path is still opt-in by setting rvm_cd_complete_flag=1.) Having said that, both times when I went into #rvm on Freenode to talk to Wayne about it, he could not have been more helpful. Having said that, I still wish that as a design decision, rvm didn't override cd.
- uxp 15y agoFor anyone that grew up outside of using a Bourne Shell (bash, sh, etc) like myself, this appears to be compatible with at least the C shell. A welcome relief, in my opinion.
- X4 15y agoI upvote this because RVM caused me more pain than salvation. I regret the time wasted for RVM. Thanks for this vamsee!
- kaylarose 15y agoBesides the whole `cd` override thing, I am curious why so many people are "confused" or have problems with RVM? (This is a genuine question. I've never had problems with RVM, but obviously others have, so I am curious)
- swatermasysk 15y agoI love the simplicity of Rbenv. I also love the "it's never good enough" mentality. I have not had any issues with RVM, but that doesn't mean people like Sam shouldn't try to build something better.
- clupprich 15y agoI think this quite reflects the whole evolution theory - something quite good is replaced by something a little bit better, which is again replaced by something a bit better, and so on, and so on, and so on.
- akmiller 15y agoIt more so to me reflects the knee-jerk reaction of many in the Ruby community to jump to newer projects simply because they are newer. I like rvm a lot and use it all the time. I'm sure rbenv is a good solution as well. I think it's a bit premature to say it's an overall better solution.
- rubyplusplus 15y agoI've never had any problems with RVM, however with that said I will absolutely check out the code on github and may try this out.
- iancanderson 15y agowas this really necessary? i think RVM does a fine job at managing rubies.
- solid 15y agoGood to see competition. RVM's "bug tracker" is the IRC channel...
- metaskills 15y agoWe are software nerds people. It is supposed to be cool to se how others solve problems. It is as simple as that.
- derekprior 15y agoI appreciate RVM and Wayne offers fantastic, other-worldly support. That said, there's always room for alternatives and I'm intrigued by rbenv. The part that gives me pause is the need to run `rbenv rehash` after installing a ruby (not so bad and possibly fixable if the aforementioned change to ruby-build is made) or after installing a gem that has binaries (I predict I will forget to do this a ton). I could definitely see myself wanting to override `gem` in order to detect binary installations and automatically rehash. At which point, it's not so unobtrusive! Still interested enough to try it out and see if that is as much of a hassle as I think it will be.
- hadis 15y agoWith RVM you can change the rubygems version for an installed ruby interpreter. Is something like these possible with rbenv too? i use rubygems -v 1.3.6 for ruby-1.8.7 and rubygems -v 1.8.6 for ruby-1.9.2. I remember i had problems using rubygems 1.8.6 with ruby-1.8.7
- dalyons 15y agoReally damn handy feature, especially with the compatibility clusterfuck that has been rubygems > 1.3.6
- xkumados 15y agorvm is easier to type than rbenv. i know aliases exist but whyyyyy? roarrr