9 ms·
Rbenv 1.0.0
- sandstrom 11y agoAnother excellent tool for the same problem is chruby[1]. I found it simpler (in a good way) than rbenv. [1] https://github.com/postmodern/chruby https://github.com/postmodern/chruby
- jph 11y agoAlso try the postmodern tools: ruby-install & chruby, which work perfectly in my experience: https://github.com/postmodern/ruby-install https://github.com/postmodern/ruby-install https://github.com/postmodern/chruby https://github.com/postmodern/chruby
- steveklabnik 11y agoHuge fan of these, been using them basically as long as they existed. They work well and are significantly simpler.
- sdegutis 11y agoYep. Moved from `rvm` to `rbenv` when it came out, but didn't realize how much magic it still did. Switched to `chruby` when it came out, was much nicer experience overall, and faster too. Just wish the Emacs package for chruby was written a little less ad-hoc.
- hvis 11y agorbenv doesn't require _any_ special integration to be used from inside Emacs. As long as chruby needs that, it doesn't seem like a good alternative to me.
- regularfry 11y agoChruby's so small that you might as well rewrite it in elisp.
- cheapsteak 11y agoAs a ruby outsider, I wonder do those have any practical effects on how you write/run programs? Do they save time or prevent bugs? Why is versioning such a huge problem in ruby?
- integraton 11y agoThey are tools for managing multiple installed versions of a programming language. When developing software, we often specify dependencies using version numbers, which indicate the version of the language or library that should be used when running the software. Running the software with the specified language runtime or library version ensures that the expected features of that library or language runtime are available and also helps avoid unexpected issues related to differences in the environments, including different developer's local systems as well as remote server environments. In the case of a programming language runtime, if you have one project that's configured to use version 2.2.4 of a language and another that's configured to use version 2.1.0, these tools provide an easy way to install and switch between the two versions. This is not unique to Ruby, and similar projects exist for other languages. For example, nvm (https://github.com/creationix/nvm https://github.com/creationix/nvm) and n (https://github.com/tj/n https://github.com/tj/n) provide something similar for Node (JavaScript), gvm (https://github.com/moovweb/gvm https://github.com/moovweb/gvm) for Go, and multirust (https://github.com/brson/multirust https://github.com/brson/multirust) for Rust.
- mfisher87 11y agoI've dabbled a little bit in Ruby, and I found this to be a much larger problem than it is with Python. Most systems have python 2 and/or python 3. Beyond that, I've rarely need to worry very much about which Python version I have. But for every new Ruby application I install on my machine, I'm messing around with rvm. Is it truly a difference between the languages release strategy or is this just my perception because of limited experience with Ruby? I found it to be a huge pain in the ass.
- lars512 11y agoIt's annoying for sure, and I like that we don't need it in Python land. But, in situations when we do want to target multiple Python versions, an identical approach using pyenv works well. I've come to appreciate it more.
- NatW 11y agoI've been perfectly content using RVM https://rvm.io/ https://rvm.io/ - with all the functionality I need, and reliability, too. What am I missing out on?
- elliotec 11y agoRbenv is much smaller and only does ruby version changes and installations with the ruby install add on. rvm is bigger and has more features but is a bigger pain to use in my experience.
- lucaspiller 11y agoAlso the whole Gemset thing is basically redundant now Bundler has become the standard way of locking dependencies (Gems).
- technion 11y agoI fell on rvm because it seems to be the "default" recommendation. I don't see a need to use something "better" if the raw tool does the job perfectly. I do get annoyed that "rvm list known" tends to only show old versions. For example, it suggests it can install ruby-2.2.1, but I'm fully aware 2.2.4 is available, as is ruby 2.3 now. And for me at least, this problem is consistent after applying the standard advice of "get the latest rvm".
- aaronbrethorst 11y agorvm was perfectly happy to install Ruby 2.3.0 for me this morning, upgrading me from 2.2.4, which is what I was using until last night.
- mwpmaybe 11y agorvm "stable" hasn't been updated in quite a while, last time I checked. you need to install the "dev" version.
- regularfry 11y agoThe problem with rvm was always that it tried to do too much. With a tool like that, as long as it's working, you won't see the downside. When it breaks, it breaks in complicated, hard-to-debug ways. If you're saying it's reliable for you, that's great. That wasn't my experience.
- robin_reala 11y agochruby didn’t work with fish last time I checked. Any idea if it does now?
- straws 11y agoFairly well! https://github.com/JeanMertz/chruby-fish https://github.com/JeanMertz/chruby-fish
- regularfry 11y agoIf you're missing niceties like gemsets around this, there are various companion projects to provide bells and whistles. I've written a couple myself: https://github.com/regularfry/gemsh https://github.com/regularfry/gemsh https://github.com/regularfry/rv https://github.com/regularfry/rv The wonderful thing is that these projects are so small and simple that writing your own tooling to interface with them feels quicker and easier than evaluating someone else's code...
- Rafert 11y agoQuick question: do you still need gemsets if you use Bundler? And why would you prefer using one instead of the other?
- why-el 11y agoGemsets are redundant when you use Bundler. Your second question will boil down to opinion but Bundler has been extremely solid in my experience. The feature set is huge and the work ethic of the core team is commendable.
- regularfry 11y agoI still use isolated $GEM_HOME directories for each project on my dev machine, and don't rely on bundler to separate installations on production machines. In my mind, bundler was never really needed for that - it was a complexity step further than was required - so I never set myself up to rely on it, instead relying on a simpler mechanism which doesn't need runtime tooling support. As a result, I never have to run `bundle exec`. How much you might prefer this will probably be more dependent on how much you appreciate simplicity.
- pbreit 11y agoI don't get why stuff like this isn't a solved problem and there's one solution that most people use.
- twblalock 11y agoAs a Java developer who used to be a Ruby developer, I can't believe how poorly dependency versioning (and just general Ruby versioning) works. It should be simple to have multiple versions of libraries coexisting on a system. Maven can do it fairly easily. RVM and rbenv seem like hacky solutions to a problem that is easily solved by specifying dependency versions in your project.
- wereHamster 11y agoHow does maven deal with multiple versions of the JRE?
- mateuszf 11y agoIt doesn't. You just install the latest java and it's fully backwards compatible.
- towelrod 11y agoThat's not really true. We still run some older Apache camel components that require Java 7. And when Java 8 first came out it had bugs that crippled Solr, it took a long time before that was stable enough to use everywhere.
- dham 11y agoWell Ruby is too. If something worked on 1.9 it works on 2.3.
- yxhuvud 11y agoYeah? Try rails 3.2.17 which work perfectly on ruby 1.9 and see how well it works on 2.2. (java is not fully backwards compatible either, but it may be a bit more tolerant in some cases)
- dbpokorny 11y agoI haven't used it, but second hand I've heard that the Python version of this concept is "virtualenv". Edit: I probably shouldn't be surprised to learn that second hand information I picked up six years ago at PyCon is out of date...
- FooBarWidget 11y agoNot so. Virtualenv's spiritual Ruby equivalent is Bundler.
- ionelm 11y agoBut technically no. Virtualenv is quite different, both in scope and approach. https://github.com/Deepwalker/pundler https://github.com/Deepwalker/pundler is more similar to bundler
- Osmose 11y agoNot quite. The Python equivalent is Pyenv: https://github.com/yyuu/pyenv https://github.com/yyuu/pyenv
- outtwre 11y agoI'm a relatively experienced python developer and have never even installed pyenv. Whereas with Ruby, I can't seem to get much working without it.
- dham 11y agoYou can take a fresh install of MacOSX and do anything with Ruby. Only issue is you need to install some gems using sudo. Same thing with using system python. You don't need rbenv by any means. In fact our designer has no problem getting our rails site running and making styling edits. Hard to say the same with installing Python 3 on MacOSX and getting virtualenv running, which in my experience hasn't been so easy. How would you work on a project that uses 3.2, then another that uses the latest features from 3.5, without pyenv?
- amorphid 11y agoI love Rbenv. Super simple, and it just works.
- mud_dauber 11y agoI wish I had the same good experience. Getting things running on Ubuntu 14.04 LTS is an unresolved hairball for me. http://stackoverflow.com/questions/23155289/rbenv-build-failed-on-ubuntu-14-04/23155490#23155490 http://stackoverflow.com/questions/23155289/rbenv-build-fail...
- davexunit 11y agoRbenv and all other such tools are narrow, weak solutions for a general problem: Using multiple versions of a piece of software on the same machine without collision. Projects like Nix and GNU Guix solve this generally without needing a new special package manager for each thing you want more than 1 version of.
- Jgrubb 11y agoI've found rbenv to be a great, narrow solution for a specific problem. And maybe those other tools you mention are great but I've never heard of them, so they could use some marketing besides this comment. That's why tools like rbenv and rvm and whatever else get more broadly picked up.
- briandear 11y agoHow is Rbenv weak? It does exactly what is needed.
- regularfry 11y agoBecause it only tackles a single language.
- regularfry 11y agoWhat would be really handy at this point is a shim around Nix to make it trivial to manage ruby versions without having to learn a whole new ecosystem. I don't want to learn Nix, I want to use Ruby. Actually, that would have been really handy about 5 years ago, but the point stands: the problem with general tools like Nix is that you need a popular, specific application of them to get them across the chasm. Not only would a wrapper script using Nix to manage ruby versions be actually useful, it ought to be relatively easy to repurpose to node, elixir, elm, GHC, whatever. Make it so that I don't need to care that I'm using Nix in the background, and I'm actually more likely to use it.