RVM Support in RubyMine 2.0.2
Many of you asked for RubyMine to support the latest RVM (Ruby Version Manager) gem and especially RVM gemset workflow. Doing this would have delayed RubyMine 2.0.2 but we still decided to add an initial support for RVM’s nice features. Now RubyMine 2.0.2 RC3 is available and you are welcome to try our hot RVM support!
I don’t like long tutorials and walkthroughs, so I’ve prepared a brief cookbook for you:
- Q: Which RVM version is supported?
A: rvm >= 0.1.25
- Q: How to configure RVM in RubyMine?
A: No configuration is needed. Install rvm gem, rvm ruby interpreters, create rvm gemsets using system console and restart RubyMine if it was running. On each startup RubyMine scans your ~/.rvm folder and automatically configures skds for each ruby interpreter and gemset pair.
P.S.: If you’ve already configured several RVM sdks manually in RubyMine please remove them and let RubyMine reconfigure sdks on next start-up.
- Q: I’ve just created a new gemset or installed new Ruby interpreter using RVM. How to enable it in RubyMine settings?
A: RubyMine detects new RVM SDKs and gemsets on the fly. Just open ‘Ruby SDK and Gems‘ panel in Settings and your new Ruby SDK will be there. If Settings dialog has been already opened – just reopen it.
- Q: I have an RVM gemset. By default it uses “local” and “global” gem paths. Does RubyMine allow to ignore “global” gem path?
A: Yes, sure. Just select “Ignore global gempath” checkbox on Ruby SDK and Gems panel in RubyMine Settings
- Q: How do I switch my project to a different gemset or RVM SDK?
A: As usual – select corresponding SDK in Ruby SDK and Gems settings, then press “Apply” button.
- Q: How can I install gems for a particular gemset?
A: Also using RubyMine Gems Manager (Ruby SDK and Gems panel). To install gems in shared (“global”) gemset choose corresponding SDK.
- Q: My project uses project .rvmrc file will RubyMine understand it?
A: On a project opening RubyMine reads .rvmrc file and sets project SDK to the one specified in .rvmrc. If “rvm use” command is commented RubyMine won’t change settings.
- Q: How do I run a script on a specific RVM gemset / Ruby interpreter?
A: Instead of switching project SDK you can just select another SDK in run configurations settings. You can always save such customized run configurations and reuse them later.
This is the initial implementation of RVM support in RubyMine. We are planning to enhance in future versions. So, we’re looking forward to your feedback.
Develop with pleasure,
-JetBrains RubyMine Team