Can't get RubyMine to see local gems on OSX

I have a 100% closed local developer user on OSX. Only XCode was setup system wide, everything else was installed in the local user folder.

I have tried adding paths to ~/.gemrc, I have tried adding paths to ~/.MaxOSX/environment.plist and nothing works for me. I can't get RubyMine to see locally installed gems. I'm not sure what else to do.

0
3 comments

Have you added ruby interpreter from your local installation folder? To do so go to File | Settings | Ruby SDK and Gems | Add SDK and point to ruby interpreter installed in your user folder.
Also, please try installing latest RubyMine (1.1 release) because we reworked gem paths detection in that release.

0
Avatar
Permanently deleted user

Ruby was installed with xcode to /usr/bin/ruby.

However, I finally figured out what the issue is and it's definitely a bug in RedMine. I noticed that RedMine was creating ~ folder in my project to store gems. At first I thought it was for local gems, but just now it occurred to me that it could be not recognizing my path. You see, I specified all paths in unix fashion, is ~/Library/Ruby and RedMine doesn't expand it to /Users/alex/Library/Ruby... after I changed my environment.plist to use full path, RedMine was able to see my local gems.

After RedMine finally was able to see my local gems, another issue surfaced. I had to click on "Attach/Install" button to get all gems attached, however RedMine didn't see some of the gems. For example, it tells me that "activerecord (>= 2.0.0)" is missing, however if I look at the list of gems from the "Attach Gems..." button, I'm seeing "activerecord 2.3.2". Attaching it manually got rid of the "missing gem" notice. I noticed that clicking "Attach/Install" repeatedly was adding the rest of the missing gems in chunks. I had to click 3 more times for the "missing" warning to completely disappear.

Hope this helps.

thnx

0

Hello Alex,

Actually RubyMine parses output of "gem environment path" command. And RubyMine automatically updates this cached information after gem installation. Thus in you case may was:
1. You changed environment.plist but RubyMine used cached gem pathes which doesn't contain some of your local paths
2. Or probably gem environment command doesn't work correct with "~".

I noticed that RedMine was creating ~ folder in my project to store gems. At first I thought it was for local gems, but just now it occurred to me that it could be not recognizing my path.

RubyMine creates *only* ".idea" folder under project root folder to store RubyMine's project settings. As for gems - RubyMine works with "gem" command. Due to RubyMine doesn't have super user access privilegies we also execute "gem" command without super user privilegies, thus gem will install gems locally under ~/.gem folder.

0

Please sign in to leave a comment.