Where is RubyMine's project gemset?

In a project folder, the gem sets I see from Rubymine vs CLI are different. Can somwone please help explain this? I am frustrated trying to debug/create simple apps when there are two different managing gemsets.

Eric

4 comments
Comment actions Permalink

In a project folder, the gem sets I see from Rubymine vs CLI are different.

Hello Eric,

Do you mean that different gems are shown in "Project View" toolwindow under "Libraries" node? If yes, then Open RubyMine | File | Settings | Ruby SDK and Gems. You need list of "attached" gems. Attached gems are only settings for RubyMine code insight features they don't affect runtime behaviour of your Ruby/Rails application.

0
Comment actions Permalink

Thanks for replying. I'll go into detail. BTW, I'm using RubyMine EAP RM-102.217, Ubuntu, & RVM

I'm thinking the different gemsets is the root problem to my previous posts. Here is an example problem. Currently cucumber is not working because of a different version of builder. When I run a cucumber task I receive the following error:

“from folder /home/ewanchic/Projects/EMMIT/”

You have already activated builder 3.0.0, but your Gemfile requires builder 2.1.2. Consider using bundle exec. (Gem::LoadError)

Ok, so I need to modify which version of builder I'm using. I'm familiar with the menu path File → Settings → Ruby SDK and Gems. I find builder and I see it has 3.0.0 and 2.1.2. So I highlight the builder gem, click “Select Versions...”, uncheck version 3.0.0, click “Ok”, and now builder 2.1.2 is the only one listed. Run Tools →  Bundler → Install; everything checks out. Run cucumber again, and again receive the error:

You have already activated builder 3.0.0, but your Gemfile requires builder 2.1.2. Consider using bundle exec. (Gem::LoadError)

This time I check my Gemfile.lock to see if it is loading it somewhere. All of my searches in this file only come up with:

(builder ~> 2.1.2)

Ok, time to switch gears on run from CLI. So I navigate to my project folder /home/ewanchic/Projects/EMMIT/ and run cucumber. This time I get an interesting error:

Using the default profile...

Could not find net-ssh-2.1.0 in any of the sources

Try running `bundle install`.

Hmm, interesting. I thought I just ran bundle install and everything worked out. Why do I need to run bundle install in CLI? ...unless I'm working with a different gemset altogether? Just for curiosity, I navigate back to File → Settings → Ruby SDK and Gems and look for net-ssh. What do you know, it's right there net-ssh 2.1.0. So I'm sure, somehow I'm using different gemsets, but in this case it almost looks like 3: one in CLI, one for cucumber?!, and one in the Ruby SDK? I am confused.

Recently, I installed/upgraded ruby to 1.9.2-p136. I did not know how to get RubyMine to automatically update/detect this, so I manually {from File → Settings → Ruby SDK and Gems → “Add SDK...”} navigated to it's path (~/.rvm/rubies/ruby-1.9.2-p136/bin/ruby). My external Libraries dropdown looks like it is pointing to the correct path (/home/ewanchic/.rvm/rubies/ruby-1.9.2-p136/bin/ruby). Finally since I am using RVM, I assume CLI is pointing to the same place as well.

So this is where I'm at, not sure what to check next. But I'll keep google searching in the meantime while I wait for your reply. Thanks a bunch.

Eric

0
Comment actions Permalink

Environment: Ubuntu 10.04, RubyMine 3.1 EAP 102.217, RVM, Ruby 1.9.2-p136

I did a lot of piecing together. This issue is related to http://devnet.jetbrains.net/message/5280709#5280709, and unfortunately still not working :(.

I orginally had all RubyMines installed in /opt/rubymine {versions}, chown as root. That worked fine (thanks to many google posts, my favorite: http://tomionrails.blogspot.com/2010/05/install-rubymine-on-ubuntu-1004.html). But, while rvm is installed in ~/.rvm, and not in a root environment, RubyMine doe not look at /home/ewanchic/.rvm, but I assumed /root/.rvm. So I removed RubyMine from the root environment and installed in /home/ewanchic/opt/rubymine {versions}. Many restarts, clean ups, and "just-to-be-sure", ~/.rvm was still not automatically loading.

My quick "give-up" solution... Add this line to the begining of the following file ../{rubylocation}/bin/rubymine.sh:

   export RVM_PATH=/home/ewanchic/.rvm

Now my home RVMs and gemsets are automatically scanned and loaded. This is fine for my work environment. However... for my home environment, I'd really like to get this setup to work:

  rubymine installed at /opt/rubymine {versions}
  rvm always installed in ~/.rvm, as in /home/{user}/.rvm

At home I'm teaching my 10 year-old son how to code in ruby/rails, and this would be a real headache if  we both had to fight/manage multiple home RubyMines and single rooted/sharing gemset confusions. I can see it now... son, you removed my gemset/ruby version I was using! crap!

Let me know how I can further Troubleshoot. Thanks

Eric

0
Comment actions Permalink

Eric,

RubyMine installation location doesn't influence on paths were RubyMine looks for rvm installation. The search algorithm is quite simple

RubyMine 3.1 EAPs

1. At first check whether ~/.rvm folder exists or not. "~" is user home folder of user, who launched rubymine. If folder exists - use it.
2. Then look at "rvm_path" env variable (also environment of a user who launched rubymine). If variable is set and value is not empty - use it.
3. Finally let's look in "/usr/local/rvm" folder - it is system wide installation.

In RubyMine 3.0 the sequence a bit different - it is 3), 2), 1), but such behavior is deprecated.

0

Please sign in to leave a comment.