10 ms·
Also try the postmodern tools: ruby-install & chruby, which work perfectly in my experience: https://github.com/postmodern/ruby-install https://github.com/post
by jph 11y ago
Also 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.
- deleted 11y ago[deleted]
- briandear 11y agoLibraries that work for an older version of ruby won't always be forward compatible. So if you're working in many projects you can't simply use the latest version of ruby. Then you have things like Jruby which is incompatible with some of the libraries designed for MRI. So, being able to segregate rubies is essential.
- 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.