How to create a new Rails app from within RubyMine on Mac OSX 10.5, with version other than 1.2.6?

I tried to update the /etc/launchd.conf file as suggested, replacing the "rome" in /Users

setenv PATH /Users/kristianconsult/.gem/ruby/1.8/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/git-core:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Still, when I create a new Rails app, I only get to select version 1.2.6. Where would I define the settings to find my other versions of the rails gems I have installed???

I can see the gems I have installed (using sudo) in /opt/local/lib/ruby/gems/1.8/gems

/Users/kristianconsult/.gem/ruby/1.8/gems also seems to have a good list of gems, including multiple rails versions.

Please advice! Should I configure the Ruby SDK to change how RubyMine finds/loads the gems?

2 comments
Comment actions Permalink

I figured it out! It was simply a matter of doing this in the console:

> which ruby
/opt/local/bin/ruby

Then from within RubyMine -> preferences -> Ruby SDK and Gems

Click "Add SDK"

select file /opt/local/bin/ruby in tree

Then click "OK"

And the correct gems list is loaded

Now I get a problem with mysql gem which I installed previously from with RubyMine even though I already had it installed before from the console (with sudo).
My socket file in /tmp/mysql.sock has been deleted
Guess I must track this gem down and delete it and perhaps reinstall mysql!? I know this issue is pretty difficult to resolve. Last time it happened I think I could only recover by deleting all the mysql relevant folders manually and then doing a reinstall... any ideas?

0
Comment actions Permalink

Hello Kristian,

On first launch RubyMine tries to setup RubySDK according PATH env variable. In you case RubyMine created SDK for Ruby interpreter bundled in MacOS X (/usr/bin/ruby). So you had to manually create Ruby SDK for /opt/loca/bin and set is as active sdk. By the way were did you setup PATH for console application? I'm asking because RubyMine at first looks in ~/.profile file for PATH env variable (only for initializing first Ruby SDK)

Now I get a problem with mysql gem which I installed previously from with RubyMine even though I already had it installed before from the console (with sudo).
My socket file in /tmp/mysql.sock has been deleted :(
Guess I must track this gem down and delete it and perhaps reinstall mysql!? I know this issue is pretty difficult to resolve. Last time it happened I think I could only recover by deleting all the mysql relevant folders manually and then doing a reinstall... any ideas?

RubyMine just executed "$ gem install mysql". I don't think that this command deletes /tmp/mysql.sock or corrupts mysql installation.

0

Please sign in to leave a comment.