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
Please sign in to leave a comment.
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
Could you attach you rubymine log file, see http://devnet.jetbrains.net/docs/DOC-1153
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
Thanks Jerry,
This worked perfectly!
Lance
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
"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
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.
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
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
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
In which folder old MacPorts rvm was installed? In /opt/local/rvm ?
Lance,
Did you install early system-wide RVM or some rvm using MacPorts?
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:
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:
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
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
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
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.
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.
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"
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
Konstantin,
Thanks, we've updated the documentation.