Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mattia  
View profile  
 More options Dec 14 2008, 10:03 pm
From: Mattia <malat...@gmail.com>
Date: Sun, 14 Dec 2008 19:03:19 -0800 (PST)
Local: Sun, Dec 14 2008 10:03 pm
Subject: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
Hello again,

a smaller issue when I set the activerecord-oracle_enhanced-adapter
gem dependency in my config/environment.rb:

no such file to load -- activerecord/oracle_enhanced/adapter
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `require'
.../vendor/rails/activesupport/lib/active_support/dependencies.rb:
148:in `require'
.../vendor/rails/activesupport/lib/active_support/dependencies.rb:
507:in `new_constants_in'
.../vendor/rails/activesupport/lib/active_support/dependencies.rb:
148:in `require'
.../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:91:in
`load'
.../config/../vendor/rails/railties/lib/initializer.rb:277:in
`load_gems'
.../config/../vendor/rails/railties/lib/initializer.rb:277:in `each'
.../config/../vendor/rails/railties/lib/initializer.rb:277:in
`load_gems'
.../config/../vendor/rails/railties/lib/initializer.rb:161:in
`process'
.../config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
.../config/../vendor/rails/railties/lib/initializer.rb:112:in `run'
.../config/environment.rb:15

Now, what is really odd is that apache" + mod_rails are working fine,
with or without that config.gem. Speaking of oddities (which might be
unrelated):

$ ruby -r oci8 -e "OCI8.new('c', 'b','c').exec('select * from dual')
do |r| puts r.join(','); end"
ruby: no such file to load -- oci8 (LoadError)

$ irb

>> require 'oci8'
=> true
>> OCI8.new('c', 'b','c').exec('select * from dual') do |r| puts r.join(','); end

=> 1

The activerecord test works too and
$  ruby -r rubygems -e 'puts Gem.path'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8
/var/lib/gems/1.8

which is expected and the obi8 lib is installed there
$ ls -d /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/
ruby-oci8-1.0.3
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/ruby-
oci8-1.0.3

any clue?

-- Mattia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raimonds Simanovskis  
View profile  
 More options Dec 15 2008, 8:41 am
From: Raimonds Simanovskis <raimonds.simanovs...@gmail.com>
Date: Mon, 15 Dec 2008 05:41:01 -0800 (PST)
Local: Mon, Dec 15 2008 8:41 am
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
1. Do you have just Ruby Enterprise Edition on this computer? No
original MRI? (Just wanted to be sure that there are no conflicts
between different Ruby installations)

2. It seems that there are some issues with oci8 installation if you
got "no such file to load" issue. Have you compiled and installed ruby-
oci8 library or have you installed it with "gem install ruby-oci8"?
If you have installed as gem then try
require ‘rubygems’
gem ‘ruby-oci8’
require 'oci8'
OCI8.new('user', 'password', 'database').exec('select * from dual') do
|r| puts r.join(','); end

if successful it should return X from this select.

2. Is activerecord-oracle_enhanced-adapter installed?
gem list activerecord-oracle_enhanced-adapter

3. Verify that activerecord-oracle_enhanced-adapter is working from
irb:

require ‘rubygems’
gem ‘activerecord’
gem ‘activerecord-oracle_enhanced-adapter’
require ‘activerecord’
ActiveRecord::Base.establish_connection(:adapter => “oracle_enhanced”,
:database => “database”,:username => “user”,:password => “password”)

and see if it is successful (use your correct database, username and
password)

As I understand your previous post is related to the same issue?

Raimonds

On Dec 15, 5:03 am, Mattia <malat...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattia  
View profile  
 More options Dec 16 2008, 1:50 am
From: Mattia <malat...@gmail.com>
Date: Mon, 15 Dec 2008 22:50:20 -0800 (PST)
Local: Tues, Dec 16 2008 1:50 am
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
Hi Ray,

thanks for your time. See below for all the answers.

On Dec 15, 10:41 pm, Raimonds Simanovskis

<raimonds.simanovs...@gmail.com> wrote:
> 1. Do you have just Ruby Enterprise Edition on this computer? No
> original MRI? (Just wanted to be sure that there are no conflicts
> between different Ruby installations)

I thought this could be the problem. I had ruby-1.8 and ruby-1.9
installed but removed them and the problem still persists.

> 2. It seems that there are some issues with oci8 installation if you
> got "no such file to load" issue. Have you compiled and installed ruby-
> oci8 library or have you installed it with "gem install ruby-oci8"?
> If you have installed as gem then try
> require ‘rubygems’
> gem ‘ruby-oci8’
> require 'oci8'
> OCI8.new('user', 'password', 'database').exec('select * from dual') do
> |r| puts r.join(','); end

> if successful it sho1uld return X from this select.

$ /opt/ruby/bin/ruby <<EOF
require 'rubygems'
gem 'ruby-oci8'
require 'oci8'
OCI8.new('u', 'p', 'db').exec('select * from dual') do |r| puts r.join
(','); end
EOF
X

> 2. Is activerecord-oracle_enhanced-adapter installed?
> gem list activerecord-oracle_enhanced-adapter

yes, it's there:
activerecord-oracle_enhanced-adapter (1.1.8)

> 3. Verify that activerecord-oracle_enhanced-adapter is working from
> irb:

> require ‘rubygems’
> gem ‘activerecord’
> gem ‘activerecord-oracle_enhanced-adapter’
> require ‘activerecord’
> ActiveRecord::Base.establish_connection(:adapter => “oracle_enhanced”,
> :database => “database”,:username => “user”,:password => “password”)

$ /opt/ruby/bin/irb
>> require 'rubygems'
=> false
>> gem 'activerecord'
=> true
>> gem 'activerecord-oracle_enhanced-adapter'
=> true
>> require 'activerecord'
=> true
>> ActiveRecord::Base.establish_connection(:adapter => "oracle_enhanced", :database => "db", :username => "u", :password => "p")

=> #<ActiveRecord::Base::ConnectionSpecification:0x99518f8
@adapter_method="oracle_enhanced_connection", @config=
{:database=>"db", :username=>"u", :adapter=>"oracle_enhanced", :password=>"p"}
>> class Tester < ActiveRecord::Base
>> set_table_name('dual')
>> end
=> nil
>> Tester.find_by_sql('select sysdate as d from dual')[0].d

=> Tue Dec 16 15:44:42 0900 2008

> and see if it is successful (use your correct database, username and
> password)

> As I understand your previous post is related to the same issue?

not really (as far as I understand), Rails was complaining about that.
To work it around I installed the gem in the Rails tree (using rails
2.2.0 and rake gems:install) and added the definition as outlined in
my previous post.

Thanks
-- mattia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raimonds Simanovskis  
View profile  
 More options Dec 16 2008, 5:59 am
From: Raimonds Simanovskis <raimonds.simanovs...@gmail.com>
Date: Tue, 16 Dec 2008 02:59:09 -0800 (PST)
Local: Tues, Dec 16 2008 5:59 am
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
OK, so it seems that all the components (ruby-oci8 and
oracle_enahnced) are working.

Then the question about your environment.rb. I use the following line
there:
config.gem "activerecord-oracle_enhanced-adapter", :lib =>
"active_record/connection_adapters/oracle_enhanced_adapter"

Do you use it in the same way?

In addition I am also using ruby-plsql gem and have the following line
in environment.rb:
config.gem "ruby-plsql", :lib => "ruby_plsql"

oracle_enhanced tries to require ruby-plsql library as well but if it
is missing then it should work also without it.
But maybe you can try to install ruby-plsql gem as well and include it
in your environment.rb file.

Raimonds

On Dec 16, 8:50 am, Mattia <malat...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
theturingmachine  
View profile  
 More options Dec 16 2008, 1:46 pm
From: theturingmachine <theturingmach...@gmail.com>
Date: Tue, 16 Dec 2008 10:46:07 -0800 (PST)
Local: Tues, Dec 16 2008 1:46 pm
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
When using the oracle_enhanced adapter with REE, I've had to install
both the ruby-oci8 library and the gem to get it to work.
Also if you want to use it with passenger, then you'll need pass the
LD_LIBRARY_PATH to passenger, since it doesn't take it from the
environment, there's a lil' hack I've found somewhere, I just don't
have it right now. Let me know if you need it, so I search for it.

On Dec 16, 11:59 am, Raimonds Simanovskis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raimonds Simanovskis  
View profile  
 More options Dec 16 2008, 2:08 pm
From: Raimonds Simanovskis <raimonds.simanovs...@gmail.com>
Date: Tue, 16 Dec 2008 11:08:42 -0800 (PST)
Local: Tues, Dec 16 2008 2:08 pm
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
I also just found that the issue is that Passenger starts with very
few environment variables and actually ruby-oci8 library cannot be
load because of missing LD_LIBRARY_PATH environment variable.

Try to put in environment.rb
require "oci8"
before
config.gem "activerecord-oracle_enhanced-adapter", ...
to verify if you can load oci8 library.

One workaround for setting environment variables for Passenger I wrote
in my blog post
http://blog.rayapps.com/2008/05/21/using-mod_rails-with-rails-applica...

Recently I found that you can also use envvars file for setting Apache
environment variables but somehow it does not work anymore on my Mac
(the file is /usr/sbin/envvars and it is executed in apachectl
script). If anyone knows what could be the issue I would like to hear
it.

There is currently issue registered in Passenger issue register about
supporting SetEnv Apache configuration directive but currently it is
not yet implemented:
http://code.google.com/p/phusion-passenger/issues/detail?id=81

Raimonds

On Dec 16, 8:46 pm, theturingmachine <theturingmach...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raimonds Simanovskis  
View profile  
 More options Dec 16 2008, 2:46 pm
From: Raimonds Simanovskis <raimonds.simanovs...@gmail.com>
Date: Tue, 16 Dec 2008 11:46:03 -0800 (PST)
Local: Tues, Dec 16 2008 2:46 pm
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
I found how to correctly add environment variables to Apache httpd
process in Mac OS X 10.5.
Edit /System/Library/LaunchDaemons/org.apache.httpd.plist
and add the following lines after <dict> line:

<key>EnvironmentVariables</key>
<dict>
    <key>DYLD_LIBRARY_PATH</key>
    <string>/usr/local/oracle/instantclient_10_2:/usr/lib</string>
    <key>NLS_LANG</key>
    <string>AMERICAN_AMERICA.UTF8</string>
    <key>TNS_ADMIN</key>
    <string>/usr/local/oracle/network/admin</string>
</dict>

Adjust environment variables according to your Oracle Instant Client
location.

On Linux it seems that you should use envvars file to set up Apache
environment variables. Look in your apachectl (or apache2ctl) script
where it is looking for envvars file.

Raimonds

On Dec 16, 9:08 pm, Raimonds Simanovskis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattia  
View profile  
 More options Dec 16 2008, 6:56 pm
From: Mattia <malat...@gmail.com>
Date: Tue, 16 Dec 2008 15:56:50 -0800 (PST)
Local: Tues, Dec 16 2008 6:56 pm
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
On Dec 16, 7:59 pm, Raimonds Simanovskis

<raimonds.simanovs...@gmail.com> wrote:
> OK, so it seems that all the components (ruby-oci8 and
> oracle_enahnced) are working.

> Then the question about your environment.rb. I use the following line
> there:
> config.gem "activerecord-oracle_enhanced-adapter", :lib =>
> "active_record/connection_adapters/oracle_enhanced_adapter"

this did it! my bad for not looking more carefully at the :lib option.

> In addition I am also using ruby-plsql gem and have the following line
> in environment.rb:
> config.gem "ruby-plsql", :lib => "ruby_plsql"

> oracle_enhanced tries to require ruby-plsql library as well but if it
> is missing then it should work also without it.
> But maybe you can try to install ruby-plsql gem as well and include it
> in your environment.rb file.

I don't have ruby-plsql and as expected ruby-oci8 is doing just fine.

Thanks
-- mattia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattia  
View profile  
 More options Dec 16 2008, 7:02 pm
From: Mattia <malat...@gmail.com>
Date: Tue, 16 Dec 2008 16:02:17 -0800 (PST)
Local: Tues, Dec 16 2008 7:02 pm
Subject: Re: rails 2.2.0 - config.gem "activerecord-oracle_enhanced-adapter" -- no such file to load
On Dec 17, 4:08 am, Raimonds Simanovskis
<raimonds.simanovs...@gmail.com> wrote:

...

> Recently I found that you can also use envvars file for setting Apache
> environment variables but somehow it does not work anymore on my Mac
> (the file is /usr/sbin/envvars and it is executed in apachectl
> script). If anyone knows what could be the issue I would like to hear
> it.

Just for the record, Debian has /etc/apache2/envvars which is sourced
in all the apache system scripts

-- mattia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »