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
Thanks, we've got you!
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 wi…
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…
RubyMine 2023.1 EAP5 Is Out!
Hello everyone, RubyMine 2023.1 EAP5 is now available! Below you can find the most notable features in this build. We encourage you to try them out and share your feedback in the comments or in our issue tracker. Migration of Ruby code to the Symbol API In order to improve code insight actions such…
The RubyMine 2023.1 EAP2 Is Out!
The RubyMine 2023.1 Early Access Program recently started and EAP2 is already here! You can get the new build from our website or via the free Toolbox App. In this post, we’ll highlight some of the most important updates included in the new EAP version. Rails 7: support for turbo-rails complet…