Rails 3.0 Internal Server Error - Not Enough Space

Hi,

I have upgraded my project from rails 2.3.4 (ruby 186) to rails 3.0 (ruby 187).

For some of the controllers I am getting following error on the frontend:

Internal Server Error Not enough space WEBrick/1.3.1 (Ruby/1.8.7/2010-12-23) at localhost:3000

Rails Console:

F:/waftt/app/controllers/reports_controller.rb:147: warning: don't put space bef ore argument parentheses [2011-04-13 20:27:35] ERROR Errno::ENOMEM: Not enough space         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/rack/log_tail er.rb:25:in `write'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/rack/log_tail er.rb:25:in `print'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/rack/log_tail er.rb:25:in `tail!'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/rack/log_tail er.rb:15:in `call'         c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/content_length.rb: 13:in `call'         c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb :52:in `service'         c:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'         c:/Ruby187/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:95:in `start'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `each'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:92:in `start'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:23:in `start'         c:/Ruby187/lib/ruby/1.8/webrick/server.rb:82:in `start'         c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb :13:in `run'         c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in ` start'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands/serv er.rb:65:in `start'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands.rb:3 0         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands.rb:2 7:in `tap'         c:/Ruby187/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands.rb:2 7         script/rails:6:in `require'         script/rails:6

Have you checked to make sure the host or virtual machine you are running on has sufficient RAM? ENOMEM could indicate RAM starvation.

- Max

Hi,

I have upgraded my project from rails 2.3.4 (ruby 186) to rails 3.0 (ruby 187).

For some of the controllers I am getting following error on the frontend:

Internal Server Error Not enough space WEBrick/1.3.1 (Ruby/1.8.7/2010-12-23) at localhost:3000

Rails Console:

F:/waftt/app/controllers/reports_controller.rb:147: warning: don't put space bef ore argument parentheses

I suggest you correct the code to remove this warning, just in case it is confusing the parser. You have a space after a function name before the '(' on the indicated line. It probably won't affect the out of memory error but it is worth doing first. My rule is to always fix the errors/warnings I understand before worrying about the ones I don't.

Colin

Max Schubert wrote in post #992663:

Hi,

I solved this bug.

Actually this was an Window XP and ruby 187 issue. The rails console executes on Windows command prompt. The command prompt had some limitations on String limit to be displayed on the cmd console.

The fix was as follows:

class String   def to_2d_array(value)     unpack("a#{value}"*((size/value)+((size%value>0)?1:0)))   end end

class << $stdout; alias old_write write; def write a; a.to_s.to_2d_array(1024).each{|little| old_write little}; end; end

Thanks to Roger Pack for http://redmine.ruby-lang.org/issues/show/1063

Thanks, Payal