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

     ... 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 M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
→ tools, scripts, tricks from our code lab: http://source.mihelac.org

Bojan M. wrote:

constant ActionView::Helpers::JavaScriptHelper::PrototypeHelper (NameError)
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 M.


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
→ tools, scripts, tricks from our code lab: http://source.mihelac.org

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

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:inload_routes!’
.//vendor/rails/actionpack/lib/action_controller/routing.rb:922:in
reload' .//vendor/rails/railties/lib/dispatcher.rb:99:inprepare_application’
.//vendor/rails/railties/lib/dispatcher.rb:39:in dispatch' .//vendor/rails/railties/lib/webrick_server.rb:111:inhandle_dispatch’
.//vendor/rails/railties/lib/webrick_server.rb:77:in service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in start' .//vendor/rails/railties/lib/webrick_server.rb:63:indispatch’
.//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

anders 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:inload_routes!’
.//vendor/rails/actionpack/lib/action_controller/routing.rb:922:in
reload' .//vendor/rails/railties/lib/dispatcher.rb:99:inprepare_application’
.//vendor/rails/railties/lib/dispatcher.rb:39:in dispatch' .//vendor/rails/railties/lib/webrick_server.rb:111:inhandle_dispatch’
.//vendor/rails/railties/lib/webrick_server.rb:77:in service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in start' .//vendor/rails/railties/lib/webrick_server.rb:63:indispatch’
.//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

I’m on Win32 and just had the same exact problem using edge rails. My
version of radrails doesn’t support mongrel so I had to start the server
from a command prompt. Mongrel does work as a Windows Service - but
that isn’t my preferred setup for development because of the restarts
necessary. Too bad I didn’t read this post before spending an hour
trying to figure it out!

For others who are not aware, script/server starts mongrel by default on
edge rails - not webrick.

Michael