Can't get even a simple Rails app to run? blocked by "“ERROR TypeError: can't dup NilClass”

“ERROR TypeError: can’t dup NilClass” in a Rails 3 app? Any ideas -
I’m just hitting the home page and get this…it was working just
before…

Gregs-MacBook-Pro:test3 greg$ rails console
Loading development environment (Rails 3.2.1)

exit

Gregs-MacBook-Pro:test3 greg$ rails server
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-02-13 09:19:59] INFO WEBrick 1.3.1
[2012-02-13 09:19:59] INFO ruby 1.8.7 (2010-01-10) [universal-
darwin11.0]
[2012-02-13 09:19:59] INFO WEBrick::HTTPServer#start: pid=8435
port=3000
[2012-02-13 09:20:27] ERROR TypeError: can’t dup NilClass
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/httprequest.rb:204:in dup' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/httprequest.rb:204:inmeta_vars’
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/
webrick.rb:34:in service' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/httpserver.rb:104:inservice’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/httpserver.rb:65:in run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/server.rb:173:instart_thread’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/server.rb:162:in start' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/server.rb:162:instart_thread’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/server.rb:95:in start' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/server.rb:92:ineach’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/server.rb:92:in start' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/webrick/server.rb:23:instart’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/webrick/server.rb:82:in start' /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/handler/ webrick.rb:13:inrun’
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:
265:in start' /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/commands/ server.rb:70:instart’
/Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/
commands.rb:55
/Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/
commands.rb:50:in tap' /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/ commands.rb:50 script/rails:6:inrequire’
script/rails:6

Note that Ruby 1.8.7 p248 and p249 have marshaling bugs that crash
Rails 3.0. Ruby Enterprise Edition have these fixed since release
1.8.7-2010.02 though. On the 1.9 front, Ruby 1.9.1 is not usable
because it outright segfaults on Rails 3.0, so if you want to use
Rails 3 with 1.9.x jump on 1.9.2 for smooth sailing.

thanks - I’m deploying to http://dreamhost.com/ and they are on ruby
1.8.7 at the moment was the reason. Any comments here? Sounds like
it might be better assuming I’ll have to do a custom ruby deployment
to the latest version on dreamhost perhaps? Their reply when I asked
the question about versions was:

======================
I’m happy to assist you. Most of our devs use version of Ruby that we
officially support which is 1.8.7. You can install any version of
Ruby that you like using the RVM method shown on the page listed
below:

http://wiki.dreamhost.com/RVM

RVM will require that you upgrade to a VPS or dedicated hosting
package. If you have any other questions let me know and I will assist
you further.

arrr - I noted I had “https” not “http” in the url I was calling.
That is I was using “https://localhost:3000”. Should this have had
such an effect on rails?

oh dear,

Just when to latest ruby 1.9.3 using rvm, but I’m still getting same
error - basically can’t use rails at all at the moment:

Gregs-MacBook-Pro:test_rvm193_1 greg$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
Gregs-MacBook-Pro:test_rvm193_1 greg$ which ruby
/Users/greg/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
Gregs-MacBook-Pro:test_rvm193_1 greg$ rails -v
Rails 3.2.1
Gregs-MacBook-Pro:test_rvm193_1 greg$

Gregs-MacBook-Pro:test_rvm193_1 greg$ rails server
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on
http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-02-13 11:30:11] INFO WEBrick 1.3.1
[2012-02-13 11:30:11] INFO ruby 1.9.3 (2011-10-30) [x86_64-
darwin11.3.0]
[2012-02-13 11:30:11] INFO WEBrick::HTTPServer#start: pid=36488
port=3000
[2012-02-13 11:30:32] ERROR TypeError: can’t dup NilClass
/Users/greg/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/
httprequest.rb:273:in dup' /Users/greg/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/ httprequest.rb:273:inmeta_vars’
/Users/greg/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/
handler/webrick.rb:34:in service' /Users/greg/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/ httpserver.rb:138:inservice’
/Users/greg/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/
httpserver.rb:94:in run' /Users/greg/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/ server.rb:191:inblock in start_thread’
^C[2012-02-13 11:31:04] INFO going to shutdown …

Any ideas?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs