RubyMine is not using the correct $PATH environment variable

I'm using RubyMine 5.4, OS X 10.8.3, RVM and Ruby 2.0.0-p247. When I try to run `db:migrate` from within RubyMine I get this error:

/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/felipecypriano/dev/MyProject/project/bin/rake db:migrate

pg_dump: server version: 9.2.4; pg_dump version: 9.1.9

pg_dump: aborting because of server version mismatch

rake aborted!

Error dumping database

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `structure_dump'

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/tasks/database_tasks.rb:142:in `structure_dump'

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:288:in `block (3 levels) in <top (required)>'

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:51:in `block (2 levels) in <top (required)>'

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <top (required)>'

-e:1:in `load'

-e:1:in `<main>'

Tasks: TOP => db:structure:dump

(See full trace by running task with --trace)

Process finished with exit code 1


If I execute from Terminal it works as expected. Then I realize that RubyMine must be using the wrong $PATH and this is what I found:

- RubyMine/Tools/Run IRB Console...

/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin/irb --prompt simple

>> puts ENV['PATH']

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/felipecypriano/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/felipecypriano/.rvm/bin:/usr/local/bin

=> nil




Terminal (using zsh, PATH configured in .zshrc. The same happens using bash)

$ /Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin/irb       

2.0.0p247 :001 > puts ENV['PATH']

/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/felipecypriano/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/felipecypriano/.rvm/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

=> nil





RubyMine $PATH is wrong. It is missing `/Applications/Postgres.app/Contents/MacOS/bin` and that's why I'm getting errors with pg_dump version.


How can I fix this?
4 comments

Could you please check if the problem reproducible with the latest RM EAP build (http://confluence.jetbrains.com/display/RUBYDEV/RubyMine+EAP)

Regards, Oleg.

0

Hi Oleg,

Yes it does. I installed RubyMine EAP 132.498, when prompted I imported the settings and the same error appears when I execute `db:migrate`.

0

Hi Felipe,

could you please file a ticket in our tracker (http://youtrack.jetbrains.com/issues/RUBY) about the problem.
Please do not forget describe the way you run RubyMine (from shell or using GUI)
Also it could be useful to provide your RM's log (Help|Show Log in ...)

Thanks in advance, Oleg.

0

Please sign in to leave a comment.