script/server vs mongrel_rails start issue

36 views
Skip to first unread message

structuralartistry

unread,
Jun 13, 2010, 4:34:44 PM6/13/10
to Ruby on Rails: Talk
I am having different results between when I start mongrel with script/
server and with mongrel_rails start.

When I run script/server to boot mongrel everything runs fine, no
errors.

When I run mongrel_rails start I get the following errors - verified
the problem on a fresh app and on two different environments (mac and
yes, windows server 2008). The actual line of fault changes but the
problem is always originating in /usr/local/bin/mongrel_rails:19

I would very much appreciate any ideas.

David


C:\webapps\creditcompare>mongrel_rails start -e production
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in
`read': can't convert Hash into Integer (TypeError)
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:89:in `load_specification'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:153:in `load_gems_in'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:152:in `each'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:152:in `load_gems_in'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:149:in `reverse_each'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:149:in `load_gems_in'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:345:in `refresh!'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:78:in `from_gems_in'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/
source_index.rb:60:in `from_installed_gems'
from C:/Ruby187/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/
gem_plugin.rb:109:in `load'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/configurator.rb:231:in `load
_plugins'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/mongrel_rails:117:in `cloaker_'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/configurator.rb:149:in `call
'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/configurator.rb:149:in `list
ener'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/mongrel_rails:99:in `cloaker_'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/configurator.rb:50:in `call'

from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/configurator.rb:50:in `initi
alize'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/mongrel_rails:84:in `new'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/mongrel_rails:84:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/../lib/mongrel/command.rb:212:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mingw32/bin/mongrel_rails:281
from C:/Ruby187/bin/mongrel_rails:19:in `load'
from C:/Ruby187/bin/mongrel_rails:19

C:\webapps\creditcompare>



Sun Jun 13 13:12:32 -0700 2010: Error calling Dispatcher.dispatch
#<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]>
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
cgi.rb:108:in `send_cookies'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
cgi.rb:136:in `out'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
http_response.rb:65:in `start'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
cgi.rb:135:in `out'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
rails.rb:81:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
159:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
158:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
158:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
285:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
285:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
268:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
268:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:
268:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
configurator.rb:282:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
configurator.rb:281:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
configurator.rb:281:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:
128:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
command.rb:212:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/local/bin/mongrel_rails:19:in `load'
/usr/local/bin/mongrel_rails:19


jschroe212

unread,
Jun 14, 2010, 10:40:57 AM6/14/10
to Ruby on Rails: Talk
We ran into the same issue. You can follow the issue here.

https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238

The fixes in the these posts did the trick for us:
Edgars Beigarts May 26th, 2010 @ 07:03 PM
bshand June 10th, 2010 @ 12:08 PM

Hope this helps!

-James

DK

unread,
Jun 14, 2010, 2:45:06 PM6/14/10
to rubyonra...@googlegroups.com
Thanks James - wondering if you also found that config.cache_classes = true caused problems? I found that the patch + changing this setting to false fixed things. config.cache_classes worked badly on 2.3.4 though also, so is a bit strange. As for the patch, I was finding that there was a nil value getting into the part of code where the patch is and that the .split was failing as it was coming in as nil.split. Strange. Was there a reason you stayed with 2.3.8 rather than just staying on an older version of rails?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


jschroe212

unread,
Jun 14, 2010, 3:16:49 PM6/14/10
to Ruby on Rails: Talk
Honestly we didn't really have a reason to upgrade to 2.3.8 besides
trying to stay at the latest release. Since I figured out a way to
get it to run I decided to keep going with 2.3.8. As for the
cache_classes, I didn't experience any behavior like that.

-James

On Jun 14, 1:45 pm, DK <dk.k...@gmail.com> wrote:
> Thanks James - wondering if you also found that config.cache_classes = true
> caused problems? I found that the patch + changing this setting to false
> fixed things. config.cache_classes worked badly on 2.3.4 though also, so is
> a bit strange. As for the patch, I was finding that there was a nil value
> getting into the part of code where the patch is and that the .split was
> failing as it was coming in as nil.split. Strange. Was there a reason you
> stayed with 2.3.8 rather than just staying on an older version of rails?
>
> On 14 June 2010 07:40, jschroe212 <jschroe...@gmail.com> wrote:
>
> > We ran into the same issue.   You can follow the issue here.
>
> >https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-do...
> > rubyonrails-ta...@googlegroups.com<rubyonrails-talk%2Bunsu...@googlegroups.com>
> > .

Maxim Shytikov

unread,
Jun 15, 2010, 6:57:21 AM6/15/10
to Ruby on Rails: Talk
Hi,

First of all, I'm sorry for my English.

Looks like I found the reason of this problem:
I use REE 1.8.7, gem v=1.3.7
problem in
... /lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':
can't convert Hash into Integer (TypeError)

because code

if defined? Encoding then File.read file_name, :encoding => 'UTF-8'

will work only with ruby 1.9
you can find difference here
http://ruby-doc.org/core-1.8.7/classes/IO.html#M000467
http://ruby-doc.org/ruby-1.9/classes/IO.html#M000125

I found that '(defined? Encoding) == true' because REXML::Encoding
loaded

Maxim Shytikov

unread,
Jun 15, 2010, 7:53:11 AM6/15/10
to Ruby on Rails: Talk
I found in my code this
'include REXML'
removing this line helped to me fix this issue.
Try to find in your code inclusion Namspace with Encoding constant
Reply all
Reply to author
Forward
0 new messages