Ruby Mine 3.0 (#RM-97.125) fails to find RVM on Mac OSX

I'm running Snow Leopard 10.6.5 which has a default Ruby interpreter pre-installed (1.8.7).  When I open a project in RM it ONLY detects the default pre-installed Ruby, NOT the rubies configured with RVM.  All of rvm, rails, gem commands work in a Terminal window.  Below is what I get when run rvm info from the command line:

$ rvm info

ruby-1.9.2-p0:

  rvm:
    version:      "rvm 1.1.1 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p0"
    date:         "2010-08-18"
    platform:     "x86_64-darwin10.5.0"
    patchlevel:   "2010-08-18 revision 29036"
    full_version: "ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]"

  homes:
    gem:          "/Users/lcranf/.rvm/gems/ruby-1.9.2-p0"
    ruby:         "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0"

  binaries:
    ruby:         "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0/bin/ruby"
    irb:          "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0/bin/irb"
    gem:          "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0/bin/gem"
    rake:         "/Users/lcranf/.rvm/gems/ruby-1.9.2-p0/bin/rake"

  environment:
    PATH:         "/Users/lcranf/.rvm/gems/ruby-1.9.2-p0/bin:/Users/lcranf/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/lcranf/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/opt/local/bin"
    GEM_HOME:     "/Users/lcranf/.rvm/gems/ruby-1.9.2-p0"
    GEM_PATH:     "/Users/lcranf/.rvm/gems/ruby-1.9.2-p0:/Users/lcranf/.rvm/gems/ruby-1.9.2-p0@global"
    MY_RUBY_HOME: "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0"
    IRBRC:        "/Users/lcranf/.rvm/rubies/ruby-1.9.2-p0/.irbrc"
    RUBYOPT:      ""
    gemset:       ""



Running Tools/Show Gem Environment displays the following (NOTE: RVM SDK is not detected and it only detects the system ruby interpreter):
RubyGems Environment:
RUBYGEMS VERSION: 1.3.7
RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
EXECUTABLE DIRECTORY: /usr/bin
RUBYGEMS PLATFORMS:
  ruby
  universal-darwin-10
GEM PATHS:
   /Library/Ruby/Gems/1.8
   /Users/lcranf/.gem/ruby/1.8
   /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
GEM CONFIGURATION:
   :update_sources => true
   :verbose => true
   :benchmark => false
   :backtrace => false
   :bulk_threshold => 1000
REMOTE SOURCES:
   http://rubygems.org/
----------------------
IDE: JetBrains RubyMine 3.0, build #RM-97.125
RubyMine SDK Environment:
Sdk: Ruby SDK 1.8.7-p174
Sdk Version: ver.1.8.7 p174
Ruby Interpreter: /usr/bin/ruby
RVM Sdk: no
Sdk Language Level: 1.8
Sdk Load Path:
     /Library/Ruby/Site/1.8
     /Library/Ruby/Site/1.8/universal-darwin10.0
     /Library/Ruby/Site
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin10.0
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0
     /Applications/RubyMine 3.0.app/rubystubs18
Sdk Gem paths:
     file:///Users/lcranf/.gem/ruby/1.8/gems
     file:///Library/Ruby/Gems/1.8/gems
     file:///System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems
     file:///Users/lcranf/.gem/ruby/1.8/bundler/gems
     file:///Library/Ruby/Gems/1.8/bundler/gems
     file:///System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/bundler/gems


I've tried several suggestions found on this board including rebooting computer, clearing out all existing Ruby Interpreters and restarting RM.  Any help would be appreciated as I'm looking to convert from Netbeans to RM for ruby dev'ing.

Thanks,

lcranf
20 comments

Lance,

I had the exact same problem using RVM 1.1.4, RubyMine 3, and Snow Leopard. After installed RubyMine I created a Dock shortcut and launched it from there. None of my RVM rubies or gemsets were seen. On a whim I tried launching RubyMine from the console:

open "/Applications/RubyMine 3.0.app"

That seemed to do jumpstart RubyMine. RubyMine launched, scanned RVM, and configured the first project using the .rvmrc file. Now when I launch RubyMine from the Dock it recognizes my RVM rubies and gemsets correctly. It's a wonky workaround but it did the trick.

-Jerry



Attachment(s):
idea.log.zip
0

Hey Roman,

I've attached the RM log file.  Jerry's suggestion actually partially worked.  It found the existing rubies installed via RVM (1.8.7 and 1.9.2), however I'm still getting missing gem errors in RM even though running "gem list" displays all the gems needed for my project.

Thanks,

LCranf



Attachment(s):
idea.log.zip
0

Thanks Jerry,

This worked perfectly!

Lance

0

I think I get something similar on Ubuntu with rvm.
I installed the nokogiri gem using "rvm 1.9.2-p0 gem install nokogiri", made sure it is available in rvm's location for 1.9.2, but still, my RubyMine project could not find it.
Restart did not help. I started RubyMine from command line.

-Kedar

0

however I'm still getting missing gem errors in RM even though running "gem list" displays all the gems needed for my project.

"Missing" - means "not attached" in File | Settings | Ruby SDK and Gems Manager, or "not installed" ?

P.S: your logs don't contains any rvm-related errors

0

Jerry is system wide rvm is also installed on your machine? RubyMine tries to detect rvm location using $rvm_path env variable,  "/usr/local/rvm" and "/opt/local/rvm", and then in "~/.rvm" folder. Thus if you launch RubyMine from console $rvm_path will be already initialized by rvm and will point to correct location. I don't understand why RM wasn't able to detect rvm in default "~/.rvm" folder.

0

If I open Ruby Mine from the Dock then I get warnings that several gems are missing and needs to be installed and attached using bundler.  Specifically it thinks that I don't have mail gem 2.2.12 installed, but only 2.2.11 installed when in fact I do (I verify this by running "gem list" from a Terminal Window).  If, however, I open RubyMine via a Terminal Window (as Jerry suggested) then everything works great!  Hope this helps.

Lance

0

Roman,

I do not have a system-wide RVM install. I have been working out of the rvm installed into my home directory (rvm 1.1.4). However, I did a system-wide find and I discovered that I have an older version of MacPorts rvm installed (1.0.5). I wonder if that caused some of the problem? I am going to uninstall the MacPorts rvm and keep only the rvm in my home directory. Maybe that will help.

-Jerry

0

Lance,

I'm glad my workaround helped. I am trying the demo of RubyMine and RVM support is absolutely critical if I am going to buy it. That's why I tried several crazy things to see if I could jumpstart it.

-Jerry

0

In which folder old MacPorts rvm was installed? In /opt/local/rvm ?

0

Lance,

Did you install early system-wide RVM or some rvm using MacPorts?

0

So I just had the same issue on RubyMine 3.0/3.0.1, Mac OS-X 10.6.5, rvm, ruby-EE.

Here is what I have tried to do, and what worked, and what didn't:

  • Started RubyMine from the dock
  • Removed all Ruby SDKs from the dropdown.
  • Added manually system default one (but not the RVM)
  • Restarted RubyMine
  • The drop down stayed exactly the same.
  • I can add rubies under ~/.rvm manually, but without gemsets it's not useful.


Then, as suggested on this thread, started RubyMine from the Terminal (with rvm environment fully set), and RubyMine perfectly re-scanned and detected all RVM gemsets (installed under /User/kig/.rvm)

I then manually removed them, and restarted RM from the dock.  Once again, RM does not re-scan, and RVM SDKs do not appear in the list.

Finally I edited my ~/.MacOSX/environment.plist (which already contained some RubyEE memory settings), and added rvm_path. Below is my complete file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>PATH</key>
  <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/nginx/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin</string>
  <key>rvm_path</key>
  <string>/Users/kig/.rvm</string>

  <key>RUBY_HEAP_MIN_SLOTS</key>
  <string>500000</string>
  <key>RUBY_HEAP_SLOTS_INCREMENT</key>
  <string>250000</string>
  <key>RUBY_HEAP_SLOTS_GROWTH_FACTOR</key>
  <string>1</string>
  <key>RUBY_GC_MALLOC_LIMIT</key>
  <string>50000000</string>
</dict>
</plist>


Logged out and logged back in.   Now even if I start RubyMine from the Dock, it loads all RVM rubies + gemsets.

Seems like RubyMine should be able to scan ~/.rvm without rvm_path set.   Not sure what's preventing it doing so. Maybe it's my PATH set in environment.plist?

Thanks!



Attachment(s):
rubies.jpg
0

Do folders "/opt/local/rvm" or "/usr/local/rvm"  exist on your hdd? RubyMine at first looks in $rvm_path, then these 2 paths, and finally in ~/.rvm. We already fixed the oder in RubyMine 3.1 branch. In future will be 1. $rvm_path 2. ~/.rvm 3. /usr/local/rvm

0

Konstantin,

I finally got around to working on this again and I tried your environment.plist fix. I didn't have an environment.plist file or even a ~/.MacOSX directory. I added the directory and used your file as my guide. I removed all entries except the rvm_path and updated the value to match my machine. It worked like a champ! Now when I launch RubyMine from the Dock it works correctly. Thank you!

-Jerry

0

Jerry,

Please read our notes related to environment.plist behaviour - http://devnet.jetbrains.net/docs/DOC-1160. It doesn't work as expected in several cases.

0

I do have /usr/local/rvm but it's not being used on my machine.

I do not have /opt/local/rvm.

Hope this helps.

0

It does now, see the comment in the thread you referred to...

"As of MacOS 10.6, the ~/.MacOSX/environment.plist approach works fine for applications launched from Spotlight and it's not necessary to edit /etc/launchd.conf"

0

Roman,

Thank you very much. I have installed the preferences pane editor as suggested by your link. The information you just provided was very useful. It would have been even more useful in December when I first post about my problem, but I'm glad I have it now.

-Jerry

0

Konstantin,

Thanks, we've updated the documentation.

0

Please sign in to leave a comment.