Error starting webrick in latest Rails

Hi all, when i try to start webrick with latest rails I got NameError for ActionView::Helpers::JavaScriptHelper::PrototypeHelper. On windows box everything works, but on linux I got folowing error:

rails tmp
cd tmp
svn co http://dev.rubyonrails.org/svn/rails/trunk vendor/rails
ruby script/server

./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:215:in `load_missing_constant': uninitialized
constant ActionView::Helpers::JavaScriptHelper::PrototypeHelper (NameError)
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:296:in `const_missing'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb:45
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:1
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:205:in `load_helpers'
         ... 15 levels...
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/railties/lib/commands/server.rb:39
        from script/server:3

Any idea what that could be?
thanx,
Bojan M.

Bojan Mihelac wrote:

Hi all, when i try to start webrick with latest rails I got NameError for ActionView::Helpers::JavaScriptHelper::PrototypeHelper. On windows box everything works, but on linux I got folowing error:

rails tmp
cd tmp
svn co http://dev.rubyonrails.org/svn/rails/trunk vendor/rails
ruby script/server

./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:215:in `load_missing_constant': uninitialized
constant ActionView::Helpers::JavaScriptHelper::PrototypeHelper (NameError)
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:296:in `const_missing'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb:45
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:1
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:205:in `load_helpers'
         ... 15 levels...
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:331:in `require'
        from ./script/../config/../vendor/rails/railties/lib/commands/server.rb:39
        from script/server:3

Any idea what that could be?
thanx,
Bojan M.

Still same problems with trunk, revision 4826. Rails app does not work on linux neither with webrick neither with fcgi, while on windows everything is fine.
Anyone had similiar problem?

Bojan Mihelac

I had the same problem, and solved it by removing the line "include
PrototypeHelper" (line 45) in
vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb.

It seems that the problem is that prototype_helper.rb is loaded first,
and it requires javascript_helper.rb, which again requires
prototype_helper.rb (where PrototypeHelper is defined). Apparently,
since parsing of prototype_helper.rb has already started, parsing of
javascript_helper.rb goes on, disregarding the "require
prototype_helper" line so that PrototypeHelper is never defined.

It is interesting that you did not experience this problem on Windows -
does it mean that the Ruby interpreter works differently wrt loading on
these platforms? I suppose it does not happen on Mac either, since all
of the core developers run Macs as far as I know, and apparently none
of them have experienced this problem (since it is still present now,
many revisions after you first discovered it).

Cheers,
Anders

Bojan Mihelac wrote:

By the way, I am still not able to run webrick with the latest
EdgeRails (revision 4867, and several earlier revisions). It starts up
fine, but I get the following error message whenever I try to access a
web page. Mongrel works fine, though.

MissingSourceFile (no such file to load --
script/../config/../config/routes.rb):

.//vendor/rails/activesupport/lib/active_support/dependencies.rb:343:in
`load'

.//vendor/rails/activesupport/lib/active_support/dependencies.rb:343:in
`load'
    .//vendor/rails/actionpack/lib/action_controller/routing.rb:930:in
`load_routes!'
    .//vendor/rails/actionpack/lib/action_controller/routing.rb:922:in
`reload'
    .//vendor/rails/railties/lib/dispatcher.rb:99:in
`prepare_application'
    .//vendor/rails/railties/lib/dispatcher.rb:39:in `dispatch'
    .//vendor/rails/railties/lib/webrick_server.rb:111:in
`handle_dispatch'
    .//vendor/rails/railties/lib/webrick_server.rb:77:in `service'
    /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
    /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'
    .//vendor/rails/railties/lib/webrick_server.rb:63:in `dispatch'
    .//vendor/rails/railties/lib/commands/servers/webrick.rb:59
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'

.//vendor/rails/activesupport/lib/active_support/dependencies.rb:350:in
`require'
    .//vendor/rails/railties/lib/commands/server.rb:39
    ./script/server:3

Anders