Reorder IDEA Path?

Hi,

I'm running into an issue whereby the path used for Rails is not the same as I use from the shell. So, the wrong binaries are being loaded, leading to some test flukiness. Is there anyway to actually change the Ruby on Rails IDEA PATH?

As a side note, it doesn't look like adding any additional paths actually does anything.

Thanks,
Kevin

13 comments
Comment actions Permalink

Hello Kevin,

Could you please describe your situation more precisely? I mean for example:

Ruby is installed in /usr/bin
Rails is installed in /some_folder

I expect rails in /some_folder to be executed, but /usr/bin/rails was run instead.

--
Oleg Shpynov
JetBrains, Inc.
http://www.jetbrains.com
"Develop with Pleasure!"

0
Comment actions Permalink

Hi,

There are two issues I'm running into, both related to the execution of external processes in tests:

1) We use xmllint for some tests. For better or worse, this actually works when run from the CLI. Our tests rely on the MacPorts executable in /opt/local/bin. This appears before /usr/bin in my PATH, but not in the IDEA PATH for Ruby on Rails, so the wrong executable is run causing test failures.

2) I can't seem to amend the path at all. We have some tests that rely on the mysql executable. Once again, they work fine when raking from the CLI, but since I can't seem to add the /usr/local/mysql/bin path to the IDEA PATH, the tests fail because it can't find the binary.

Please let me know if you need any additional info.

--
Kevin

0
Comment actions Permalink

You can extend Idea's PATH for Ruby/Rails scripts in "Settings | Ruby On Rails | Additional Paths". Or you can change PATH env variable in run configurations

0
Comment actions Permalink

Just to clarify, adding a path would not change the order of existing entries. Also, I'm stating that the "add additional paths" portion is not working at all. This is 8858.

I'll try your other suggestion.

0
Comment actions Permalink

1) reordering path:
You can change PATH in settings of run configuration to:

In this case PATH of child ruby process will be : /your/path:/usr/bin:/bin:/usr/sbin:/sbin

2) adding /usr/local/mysql/bin to PATH:

>I'm stating that the "add additional paths" portion is not working at all
We've fixed two issues http://www.jetbrains.net/jira/browse/RUBY-1946, http://www.jetbrains.net/jira/browse/RUBY-1959 concerned your problem. But at current moment we cannot publish updated version of plugin because we are fixing some critical bugs in our type inference and Rails Project View. We are going to update plugin next week. So you can use 1)

0
Comment actions Permalink

Hi Roman,

Thanks for the reply. Your suggestion for #1 did indeed allow me to get my tests passing. It'd still be nice if this could be handled in the IDE preferences so I don't have to keep setting it up for every runtime configuration. But, I'm quite happy to see all my tests passing.

Thanks again.

--
Kevin

0
Comment actions Permalink

Is there going to be any way to change the PATH outside of the run configuration? The PATH being used now is never going to work for any of my projects . . . this is why I set up my PATH appropriately in my profile. It's very strange for me to have to configure this separately on every runtime configuration. If the plugin either: a) used my actual PATH value, or b) let me change it in a central location, a lot of my headache would go away.

0
Comment actions Permalink

Hi Kevin,

All should work.
1. You can extend your PATH in Settings|Ruby On Rails|Additional Path
2. If you want to override PATH in run configuration you should set PATH in run configuration env. variables dialog
e.g.

If you want to extend PATH you should write


I've just check it on RubyMine and it works.

0
Comment actions Permalink

Hi Roman,

Everything works as you describe. The problem is that the PATH is never correct by default. Having to override it for every runtime configuration is an unnecessary hassle. Rather than update it in 1 place, I have to update it in n places.

Where is the default PATH coming from? Why not just use my PATH value set up as an env var?

Thanks,
Kevin

0
Comment actions Permalink

Mac OS use different PATH values for Applications and console. That's why we added setting "Settings|Ruby On Rails|Additional Path". I don't understand why this feature doesn't suit you.
E.g.
IDEA/RubyMine default PATH = /usr/bin

Let's set "Additional Path" folders = /my_folder1:/my_folder2

Then PATH in ruby scripts will be: /usr/bin:/my_folder1:/my_folder2
If you specified PATH in run configuration settings: PATH = /for_current_test:$PATH$ the whole PATH will be: /for_current_test:/usr/bin:/my_folder1:/my_folder2

P.S: Also there is some hint concerned changing default PATH for all .app but I don't remember it(you should create some properties file with special name in special folder)

0
Comment actions Permalink

The issue is that I've already set my PATH in my .profile. The Ruby plugin completely ignores that setting and provides a PATH that will never work for my projects. It always loads MacPorts after the default tools, whereas I rely on MacPorts to override the default tools. So, it's not just adding additional paths, it's reordering the existing ones.

Setting the PATH in the runtime configuration does work . . . I just have to do it for every single configuration. If I have 10 projects, each with 4 different configurations (rake, server, production and development environments), that means I have to set the path in 40 different runtime configurations. Not only is that a horrible waste of time, but then if I ever need to change my PATH, I need to update 40 different configurations. It's just a very odd way of doing things, in the same way that it wouldn't be acceptable to have to do PATH= before every invocation of rake . . . that's the point of having a central location of setting the variable value.

Even if you can't load my PATH settings out of the environment, I should be able to override the PATH set in the plugin settings.

0
Comment actions Permalink

Kevin Menard wrote:

The issue is that I've already set my PATH in my .profile. The Ruby plugin completely ignores that setting and provides a PATH that will never work for my projects. It always loads MacPorts after the default tools, whereas I rely on MacPorts to override the default tools. So, it's not just adding additional paths, it's reordering the existing ones.


This is not specific to IDEA or RubyMine, but it's the way OS X works.
If you want to set a default path for GUI applications, edit
~/.MacOSX/environment.plist and set your PATH there.

For more info:

http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093-113982

-- Marcus

0
Comment actions Permalink

http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093-113982

Marcus, you are right. Thanks for link!


-



I should be able to override the PATH set in the plugin settings.

Kevin, it sounds reasonable. It may be usefull for Mac OS users if they want to change PATH env. variable value only for RubyMine/IDEA and doesn't want that their change affect other Mac OS Applications(on windows they can change env.variables in idea.bat, on linux - idea.sh).

0

Please sign in to leave a comment.