RubyMine 8 Beta: Rbenv Gemsets
We’d like to apologize for not making any EAP builds available for the last two weeks. We’ve been polishing one of the major features of the upcoming release – support of rbenv gemsets, which we wanted to make ready for the Beta. Today we’re happy to announce RubyMine 8 Beta is available to download and try!
We continue our series of blog posts about the major new features of the upcoming RubyMine release: Bundler Support Improvements, React Support Improvements, New Debugging Option, New UI for Testing, Adjustments for Color Deficiency, Faster Debugger, IDE Look and Feel Improvements.
RubyMine has supported RVM gemsets for a while, and we’ve been asked to add support for rbenv gemsets as well for quite a while. Unlike RVM, rbenv doesn’t have native gemset functionality, but thanks to rbenv-gemset plugin using gemsets with rbenv now seems to be quite common.
To show you rbenv support features, let’s assume I have rbenv SDK with ruby-debug-ide (0.5.0) gem installed. But I want to use ruby-debug-ide (0.6.0) for my project and want to manage it with a gemset.
Creating a new gemset
I’m going to start with creating a new gemset. There are two ways to create a new gemset in RubyMine. First of all you can simply use Terminal as you are used to:
You can also add a .rbenv-gemset file to your project and add a new gemset name to it. Every time you invoke a Bundle command or change a gemfile, RubyMine checks .rbenv-gemset file and creates gemsets listed there if they don’t exist. Just make sure rbenv sdk is chosen in your project settings:
Managing list of gemsets
You can always check what gemsets are switched on in your project in Preferences | Languages & Frameworks | Ruby SDK and Gems:
If you want to switch your gemset off or on, please use button.
Every time you change a list of project gemsets, .rbenv-gemset file is updated accordingly. And vice versa, every time you change .rbenv-gemset file, project settings are changed. Please note you can also use code completion inside .rbenv-gemset for both gemsets and local project directories:
Managing gems in a gemset
Every time you install a new gem, whether with the help of Bundler or not, it will be installed into a gemset that is listed first in .rbenv-gemset file. If there are no gemsets (no .rbenv-gemset file) in a project, the gem will be installed directly into rbenv SDK folder.
In my example I want to install ruby-debug-ide (0.6.0) to the gemset I’ve created. So I need to specify a version in my gemfile and run the Bundle install command (Tools | Bundler | Install):
To see the list of gems available for a project, look in the External Libraries directory. Now we have ruby-debug-ide (0.6.0) available here:
Please note that we are still working on the feature and there may be issues, which we ask you to report to our issue tracker so we can polish it for the final release.
The full list of fixed issues can be found in the release notes.
Please take a look at all the new RubyMine 8 features, download and try it from our site.
Develop with pleasure!
JetBrains RubyMine Team
Subscribe to Blog updates
RubyMine 2024.1 Early Access Program is Open!
The RubyMine 2024.1 Early Access Program has now started! In this blog post, we’ll share our plans for the upcoming release and the areas we’re currently focusing on. The first EAP build includes performance and usability improvements, bug fixes, and updates to RBS language support.Now, you c…
RubyMine 2023.3 EAP Update
Hello everyone! We’re back with an update on the state of the 2023.3 Early Access Program. You can download the latest EAP build from our website, via the free Toolbox App, or by using snaps for Ubuntu. Here are the biggest highlights of this release: Performance improvements As we me…
The RubyMine 2023.3 Early Access Program Is Open!
Hello everyone, The third RubyMine Early Access Program of 2023 is underway! The key change in the first EAP build is an important indexing optimization. By refactoring our code base, we’ve doubled RubyMine’s indexing speed compared to v2023.1. This is particularly noticeable when working…
Performance Improvements in RubyMine 2023.1
Hello everybody, The new release is fast approaching, so it’s time to unveil the performance enhancements you can expect from RubyMine 2023.1. Faster code completion When developing and supporting RubyMine, we analyze a great load of anonymized usage data. A lot of recent data pointed to the fact t…