0

I am new to RubyMine and I have imported an existing project to the IDE. I have many gemsets and I have the .ruby-version and .ruby-gemset files setup correctly in the project so when I go to my project directory the right gemset is automatically getting used. The same gemset is shown to be used in RubyMine Settings under "Ruby SDK and Gems". However when I load the project it complained about missing gems - whereas "bundle install" on my command line indicated everything was good.

I then tried to run a Cucumber Scenario Step and it complained that cucumber-rails gem wasn't installed but doing a "bundle show cucumber-rails" on the command line showed it was installed in the right place. I also confirmed that in RubyMines under the gemset being used.

Not sure why it was complaining about missing gems I ran the bundle install command through RubyMine and it went ahead and installed all the gems under a different version of ruby that I am not using for this project.

So I am not sure why the gemset that RubyMine shows is using for the project is not the one it is using to check for the gems it needs.

Thanks for your thoughts/feedback.

Sanjay.

3 Answers3

0
  1. Use a .rvmrc file instead, RubyMine doesn't recognize those others. Sample content rvm use ruby-1.9.3@myapp --create
  2. Sometimes when you add a new gemset and you already have rubymine running, it appears you need to restart so it will rescan your gemsets. This isn't often, but sometimes when you have multiple windows open it seems necessary.
kross
  • 3,627
  • 2
  • 32
  • 60
  • 1
    regarding #2, for years now, i've always had a problem with this. Sometimes I need to close, and re-open rubymine like 7 or 8 times. Extremely annoying. It basically never recognizes it on its own if you add an rvmrc file while rubymine is already open. – Sean Jun 26 '14 at 15:58
0

Here's a solution I implemented after reading what JetBrains says about .rvmrc files :

RubyMine Info

If you have provided .rvmrc file for your project, RubyMine parses this file on project opening. The Ruby SDK and gem sets, specified in the project .rvmrc file, are shown in the Ruby SDK and Gems page of the Settings dialog. If rvm use command is commented out, RubyMine doesn't change settings.

Any changes made to the project .rvmrc file are only applied after project restart.

Solution

So, I edited the .rvmrc file to uncomment the rvm use section as described above. Therefore, this:
# echo "rvm use 2.1.2@blocmetrics" > .rvmrc
became this:
echo "rvm use 2.1.2@blocmetrics" > .rvmrc (the # comment symbol removed)

Also, I selected Settings > Language & Frameworks > Ruby SDK and Gems > Ignore global gempath
This prevents RubyMine from using the global gempath.

These changes seemed to work and RubyMine chooses my correct gemset now. I verify that by going into the RubyMine terminal and checking rvm gemset list to confirm I have my correct gemset selected.

Community
  • 1
  • 1
ckib16
  • 383
  • 4
  • 8
0

Maybe this information could help https://github.com/microsoft/vscode-remote-release/issues/930

My main problem was when I opened project's folder whithout cd command. I managed to fix this by adding cd . to my .bashrc script

yvikt
  • 11
  • 3