RubyMine's rails console having trouble finding things

I open my app in RubyMine and then open the Rails console within RubyMine, choosing the appropriate environment, and it displays two error messages while looking for required gems:

1) vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection':RuntimeError: Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem.)

2) vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in `const_missing':NameError: uninitialized constant ApplicationController::SESSION_TIMEOUT_MINS

First it says to install the activerecord-oracle_enhanced-adapter gem, then says that the activerecord-oracle_enhanced-adapter gem can't load the ruby-oci8 library.  If I have to install the oracle_enhanced, how can it be that it's already running and can't find ruby-oci8?  I do not have oracle_enhanced or ruby-oci8 issues when running script/console in terminal.

The second error above can't find the constants in my config/initializers/constants.rb file, which is found just fine when running the app under apache.



Could it be I need to set env variables under ~/.MacOSX/environment.plist?  If so, specifically which ones?  I saw the document on this wiki that details how to setup the path using the Environment Variables pref pane.  Do I have to duplicate every entry in my ~/.bash_profile settings file in the environment.plist file?   

-=Randy

2 comments
Comment actions Permalink

I copied all the env vars from ~/.bash_profile to ~/.MacOSX/environment.plist via the Environment Variables system preference pane, rebooted, and the rails console started working inside RubyMine. :)  No more oracle_enhanced / ruby-oci8 issues, and it found my config/initializers/constants.rb file.  

However, now some of my other apps that have never had issues won't even launch.  After snooping through the console logs, I found that the normal ":$PATH" tagged onto the end of the path var wasn't working as it does in ~/.bash_profile.  So /usr/bin, /bin, /usr/sbin, /sbin entries were missing, causing my other apps to die.

Someone might want to update the document explaining how to use Environment Variables preference pane to set env vars to include these important locations to the $PATH var.

It's not a fix-all solution... RubyMine still can't seem to find external gems when trying to create a new project, but there's another thread on here dealing with that one.
-=Randy

0
Comment actions Permalink

I copied all the env vars from ~/.bash_profile to ~/.MacOSX/environment.plist via the Environment Variables system preference pane, rebooted, and the rails console started working inside RubyMine. :)  No more oracle_enhanced / ruby-oci8 issues, and it found my config/initializers/constants.rb file.

Ok, good. Unfortunately it is a pain in the neck, it is some strange limitation of  MacOS and lots of our users have troubles with it.

Someone might want to update the document explaining how to use Environment Variables preference pane to set env vars to include these important locations to the $PATH var.

Thank, done. See http://devnet.jetbrains.net/docs/DOC-1160.

0

Please sign in to leave a comment.