gem_path not respected by intellij

已回答

I am using intellij ultimate 200=17.2

I have a simple jruby project I want to integrate with intellij.  

I run intellij in my mac this way (via the script below)  so I inherit environment variables:

 

source setenv.sh

 

JAVA_HOME=/Library/Java/Home

cd /Applications

open IntelliJ\ IDEA.app/

 

in particular, I set GEM_HOME and GEM_PATH, which I need to find some gems used by my project

but when I go to tools -> show gem enviroment I see that my GEM_PATH has not bee respected, so I cannot test, run or debug my project

 

1.  why GEM_PATH from the env is not respected?

2. How do I configure this so it can use my GEM_PATH?

0

Setting environment on Mac is tricky, it depends on the macOS version and the way the app is started.

Please check these answers to find which one works for you:

http://apple.stackexchange.com/q/51677
http://apple.stackexchange.com/q/57385/17551
http://stackoverflow.com/q/135688/104891

0

Hi Serge,

 

I am using macOS 10.12.6.  

solution 1 doesn't work (adding to .bash_profile)

solution 2 is really old, and I cannot is not workable (applescirpt dependency)

solution 3 doesn't work (adding to /etc/lauchd.conf)

My solution used to work until I updated yourkit.   If macOs is supprted, please give me a definite answer.  I can make no progress until this gets resolved.

 

thanks for your help,

 

fdo

0

See https://stackoverflow.com/questions/25385934/setting-environment-variables-via-launchd-conf-no-longer-works-in-os-x-yosemite answer for the latest macOS versions.

The problem you have has no relation to JetBrains products, but how macOS manages environment variables for different application types.

0

I am adding [1], restarting and then invoking intellij (via spotlight).  I still see the wrong GEM PATHS:

GEM PATHS:
/Users/fcastano/dev/qa/SysTest/perfEngSearch/srrc/jruby/jruby-1.7.19/lib/ruby/gems/shared
/Users/fcastano/.gem/jruby/1.9

so this is not working either.  Am I doing something wrong?

 

[1] 

fcastano-ltm8:bin fcastano$ more ~/Library/LaunchAgents/

com.citrixonline.GoToMeeting.G2MUpdate.plist  com.logmein.GoToMeeting.G2MUpdate.plist       environment.plist

fcastano-ltm8:bin fcastano$ more ~/Library/LaunchAgents/environment.plist

CTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

  <key>Label</key>

  <string>my.startup</string>

  <key>ProgramArguments</key>

  <array>

    <string>sh</string>

    <string>-c</string>

    <string>

    launchctl setenv GEM_HOME /Users/fcastano/dev//qa/SysTest/perfEngSearch/srrc/jruby_gem_home/

    launchctl setenv GEM_PATH /Users/fcastano/dev//qa/SysTest/perfEngSearch/srrc/jruby/jruby-1.7.19/lib/ruby/gems/shared:/Users/fcastano/dev//qa/SysTest/perfEngSearch/srrc/jruby_gem_home/

    </string>

 

  </array>

  <key>RunAtLoad</key>

  <true/>

</dict>

</plist>

0

Check idea.log (https://intellij-support.jetbrains.com/hc/articles/207241085). It runs a py script to detect the environment. You can try running it manually to see the results returned.

If it still doesn't work, please file a bug at https://youtrack.jetbrains.com/issues/RUBY with the steps to reproduce.

0

请先登录再写评论。