Forum: Ruby on Rails NoMemoryError Oracle

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2e345d5ffd1a222af9e6b1a6b2d084f7?d=identicon&s=25 David Poole (Guest)
on 2006-04-28 22:24
(Received via mailing list)
Hello,

I'm trying to run rails on a Solaris 10 box with Ruby/OCI8, but I'm
getting the following errors when trying to start up.

# script/server
=> Booting WEBrick...
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/
webrick.rb:49:in `[]=': failed to allocate memory (NoMemoryError)
         from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/
commands/servers/webrick.rb:49
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:21:in `require'
         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/
lib/active_support/dependencies.rb:147:in `require'
         from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/
commands/server.rb:30
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:21:in `require'
         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/
lib/active_support/dependencies.rb:147:in `require'
         from script/server:3
# script/console
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/console.rb:
18:in `[]=': failed to allocate memory (NoMemoryError)
         from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/
commands/console.rb:18
         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:21:in `require'
         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/
lib/active_support/dependencies.rb:147:in `require'
         from script/console:3


I only get the error after installing Ruby/OCI8.

Rails 1.1.2
Oracle Instant Client 10.2
Ruby/OCI8 0.1.15

There is plenty of free memory on the system.

Any ideas?

Thanks,
Dave
6ece05caebbfa91944047629101bc5ea?d=identicon&s=25 KUBO Takehiro (Guest)
on 2006-04-29 10:52
(Received via mailing list)
Hi,

David Poole <David.Poole@fccc.edu> writes:

> Hello,
>
> I'm trying to run rails on a Solaris 10 box with Ruby/OCI8, but I'm
> getting the following errors when trying to start up.
>
> # script/server
> => Booting WEBrick...
> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/
> webrick.rb:49:in `[]=': failed to allocate memory (NoMemoryError)
>          from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/

webrick.rb:49: ENV["RAILS_ENV"] = OPTIONS[:environment]

> # script/console
> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/console.rb:
> 18:in `[]=': failed to allocate memory (NoMemoryError)
>          from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/

console.rb:18: ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] ||
'development'

> I only get the error after installing Ruby/OCI8.
>
> Rails 1.1.2
> Oracle Instant Client 10.2
> Ruby/OCI8 0.1.15
>
> There is plenty of free memory on the system.
>
> Any ideas?

I can't imagine why it occurs. But it may be caused by a change in
0.1.15. How about reverting the change?

vi ext/oci8/oci8.c
-------------------------------
void
Init_oci8lib()
{
#ifndef _WIN32                                          <- delete
  ruby_setenv("", NULL); /* duplicate environ vars */   <- delete
#endif                                                  <- delete

  /* Handle */
  cOCIHandle = rb_define_class("OCIHandle", rb_cObject);
-------------------------------

If this is the cause, I must release 0.1.15.1.

--
KUBO Takehiro
email: kubo@jiubao.org
web:   http://www.jiubao.org
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1  9F47 C001 1F93 AC08 2262
6ece05caebbfa91944047629101bc5ea?d=identicon&s=25 KUBO Takehiro (Guest)
on 2006-05-03 19:11
(Received via mailing list)
Hi,

KUBO Takehiro <kubo@jiubao.org> writes:

> David Poole <David.Poole@fccc.edu> writes:
>
>> Hello,
>>
>> I'm trying to run rails on a Solaris 10 box with Ruby/OCI8, but I'm
>> getting the following errors when trying to start up.
(snip)
>> I only get the error after installing Ruby/OCI8.

I installed Solaris 10 x86 and I got the same error.

>> Rails 1.1.2
>> Oracle Instant Client 10.2
>> Ruby/OCI8 0.1.15
>>
>> There is plenty of free memory on the system.
>>
>> Any ideas?
>
> I can't imagine why it occurs. But it may be caused by a change in
> 0.1.15. How about reverting the change?

No. It doesn't solve.

Add the following code to the top of
'/usr/local/lib/ruby/site_ruby/1.8/oci8.rb'

   ENV['ORA_NLS_PROFILE33'] = "" if ENV['ORA_NLS_PROFILE33'].nil?
   ENV['ORA_NLS10'] = "" if ENV['ORA_NLS10'].nil?
   ENV['ORACLE_HOME'] = "." if ENV['ORACLE_HOME'].nil?

Instant Client set these environment variables if they aren't set.
If the key name is a new one, it causes problem. So set the same key
in advance.

--
KUBO Takehiro
email: kubo@jiubao.org
web:   http://www.jiubao.org
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1  9F47 C001 1F93 AC08 2262
2e345d5ffd1a222af9e6b1a6b2d084f7?d=identicon&s=25 David Poole (Guest)
on 2006-08-03 14:22
(Received via mailing list)
Thanks for your help!
Adding the code to oci8.rb works.

-Dave


On Apr 30, 2006, at 7:37 AM, KUBO Takehiro wrote:

> (snip)
>>> Any ideas?
>    ENV['ORA_NLS10'] = "" if ENV['ORA_NLS10'].nil?
> GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1  9F47 C001 1F93 AC08 2262
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

--
David Poole
Programmer/Analyst II
Fox Chase Cancer Center
This topic is locked and can not be replied to.