How to use .bash_profile (paths) on Lion so Oracle db connections work?

Getting oracle to work on lion is a bear with ruby-oci8. Have to do a 32-bit ruby install, and set up a bunch of paths and symlinks, etc. In any case, all that is working and I can connect to Oracle with a ruby script.

However, when I start a server in Rubymine for a rails app, I get the following in the console:

/Users/mfoster/.rvm/rubies/ruby-1.9.2-p290-i386/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/mfoster/projects/library_admin/script/rails server -b -p 3001 -e development
oci8lib.c:127:in oci8lib_191.bundle: OCI Library Initialization Error (OCIError)
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/ruby-oci8-2.1.0/lib/oci8.rb:43:in `require'
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/ruby-oci8-2.1.0/lib/oci8.rb:43:in `<top (required)>'
 from /Users/mfoster/projects/library_admin/config/application.rb:10:in `require'
 from /Users/mfoster/projects/library_admin/config/application.rb:10:in `<top (required)>'
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/railties-3.1.3/lib/rails/commands.rb:52:in `require'
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/railties-3.1.3/lib/rails/commands.rb:52:in `block in <top (required)>'
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
 from /Users/mfoster/.rvm/gems/ruby-1.9.2-p290-i386@lib_admin/gems/railties-3.1.3/lib/rails/commands.rb:49:in `<top (required)>'
 from /Users/mfoster/projects/library_admin/script/rails:6:in `require'
 from /Users/mfoster/projects/library_admin/script/rails:6:in `<top (required)>'
 from -e:1:in `load'
 from -e:1:in `<main>'

Process finished with exit code 1

If I run it in a terminal, everything works:

rails server -e development -p 3001
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-01-31 21:34:45] INFO  WEBrick 1.3.1
[2012-01-31 21:34:45] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin11.2.0]
[2012-01-31 21:34:45] INFO  WEBrick::HTTPServer#start: pid=2425 port=3001

My .bash_profile is:

export DYLD_LIBRARY_PATH=/usr/local/oracle/instantclient10_2

It seems the problem is that launching the server in Rubymine fails because it is not aware of the various paths, etc.

How can I configure rubymine to be aware fo the paths in .bash_profile?

Thanks in advance.
Comment actions Permalink

This happens due to how OS X works with environment variables. You can see tip on how to setup environment variables to be picked up by RubyMine here:

Comment actions Permalink

Thanks. Since found this:

Setting variables in /etc/launchd.conf seems more straight forward and you don't need to install an app.


Please sign in to leave a comment.