Follow

Ruby developers on Linux, what's your preferred Ruby?

@passthejoe I use system ruby by default, and chruby+ruby-install when I need a specific ruby for an app/library/project.

@postmodern For now I got rid of all the distro-supplied gems. I'll try rbenv soon -- I used it on my last OS (CentOS Stream) but not since I've been on Fedora.

@passthejoe Fedora's rubygems package is nice since they patched it to install gems into ~/.gem/ for normal users, so you don't have to run `sudo gem install` for all gems.

@postmodern I never know if I'm supposed to do 'sudo gem install' or just 'gem install'. Do they go to the same place, or does sudoing put it somewhere else?

@passthejoe check `sudo gem env` vs `gem env`. Installing a gem via sudo causes it to go into /usr/local/share/gems (which is global), where as non-sudo gem install goes into ~/.gem/ (which is local to the user).

@postmodern Thank you for this. I imagine I could remove the globals and then reinstall as local.

@postmodern But I guess I should figure out Bundler, or something similar.

@passthejoe bundler is excellent and every professional ruby job I have had relies on it extensively.

@passthejoe bundler is for when you need to isolate and lock down the gem dependencies of an app or library.

@postmodern @passthejoe But it also makes it a lot easier to keep a whole bunch of gems up to date, or to install them on a new machine. If you want to give your code to someone else, it's pretty much standard for that reason. They just type "bundle install".

@passthejoe @postmodern You probably don't need the gem to be available to every user on your computer, so you don't need to sudo it.

@passthejoe RVM / rbenv isn't *a* Ruby, of course; it means you get *all* the Rubies. Every version of every Matz Ruby, jRuby, etc etc

I have used both RVM and rbenv, they're both good. I have spent multiple days debugging a problem with RVM, which hasn't happened to me (yet) with rbenv. Currently using rbenv.

@passthejoe the real question is MRI vs jruby vs truffle ruby.

github.com/codicoscepticos/rub

@bcgoss @passthejoe jRuby has a number of benefits; I've used it at work where they're into Tomcat, so they could just deploy as normal. Plus you get parallelism -- maybe; the problem is that your dependencies were probably not designed with that in mind.

@passthejoe I'm using asdf, which also uses ruby-build, like rbenv, so same ruby, different version manager.

@threedaymonk @halfbyte @passthejoe

asdf? Does that stand for something significant, or could someone just REALLY not be bothered that day? 😂

@passthejoe I usually go with the distro, but if it's too old, compile. I have looked at rbenv once, but generally only need to have 1 version, so RVM/rbenv no use to me. rbenv looked like a decent option for an easy standalone compile.

@passthejoe We'll be releasing the results of the biennial Rails Community Survey in a few weeks... asdf has been creeping up into the mix

Sign in to participate in the conversation
Ruby.social

A Mastodon instance for Rubyists & friends