Really bad problem with Webrick/Rails using 3.1 - Help?

First, I’m probably not going to describe this problem perfectly
because I am not entirely sure what it happens - please bear with me.

I am getting some weird instability issues with Webrick/Rails 3.1 when
I render views that contain my_route_path’s that don’t actually exist
in the ERB file.

What will happen is that my Ubuntu will start lagging, the mouse
becomes choppy and my entire system destabilizes. I try and CTRL-C
webrick, but it takes a long time to get it to shut down. Even worse,
Ubuntu is still sluggish and I have to kill the terminal window
entirely for Ubuntu to start behaving properly.

It takes about 60 seconds for Webrick to figure out what went wrong
and tell me that the route_path didn’t point to an instance variable
or method.

As you can imagine, this is pretty frustrating/annoying and really
interrupts with a nice, pleasant workflow.

I can at least verify that “render_views” in test does not cause this
problem when a route_path is not defined… so there’s something
specific to actually testing your site in a browser. It may happen on
other web servers… I don’t know… but I am using webrick.

It may also have something to do with the asset pipeline too… just
before it reports the error, I can see debugging information that it’s
compiling a whole bunch of my javascript requires from the
application.js manifest.

Is this a known problem? Is there a solution to this? Does anything I
wrote make any sense at all? I wish I knew more about Rails to give
you better info. This is the best I can do.

Yeah, I don’t think it has anything to do with the asset pipeline - it
is definitely a problem with the routes.

I made a change on purpose to cause the route to fail, and it causes
the effects that I am talking about. Here’s some webrick verbiage.

Notice that it took “35147ms” to complete the request, which is faster
than usual. My experience, it has been around 60 seconds.

Compiled ~/websites/training/vendor/assets/javascripts/json2.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/jquery.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/jquery_ujs.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/
jquery.tokeninput.js (0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/
jquery.jcrop.js (0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/
jquery.fancybox.js (0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/
jquery.highlight.js (0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/jquery-ui.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/font.js (0ms)
(pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/underscore.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/ICanHaz.min.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/javascripts/require.js
(0ms) (pid 11670)
Compiled ~/websites/training/app/assets/javascripts/application.js
(0ms) (pid 11670)
Compiled ~/websites/training/vendor/assets/stylesheets/token-input-
facebook.css (0ms) (pid 11670)
Rendered my/learning_programs/show.html.erb within layouts/secure
(34822.4ms)
Completed 500 Internal Server Error in 35147ms

ActionView::Template::Error (undefined local variable or method
learning_programs_path' for #<#<Class:0x0000000531a650>: 0x00000005314408>): 2: <h2>Actions</h2> 3: <ul> 4: <li><%= link_to 'Edit', edit_my_learning_program_path(@learning_program) %></li> 5: <li><%= link_to 'Back', learning_programs_path %></li> 6: </ul> 7: </div> 8: app/views/my/learning_programs/show.html.erb:5:in_app_views_my_learning_programs_show_html_erb__3908718312905001099_43552220’

Here’s another one:

ActionView::Template::Error (undefined local variable or method
edit_user_password' for #<#<Class:0x00000004c829f0>: 0x00000004c70b60>): 51: 52: <tr> 53: <td>Password:</td> 54: <td>[HIDDEN] (<%= link_to "Reset Password", edit_user_password %>) 55: </tr> 56: 57: <tr class="subHeader"> app/views/my/profile/show.html.erb:54:in_app_views_my_profile_show_html_erb___3947683302502441865_40045180’

Rendered /home/egervari/.rvm/gems/[email protected]/gems/
actionpack-3.1.0.rc1/lib/action_dispatch/middleware/templates/rescues/
_trace.erb (1.0ms)
Rendered /home/egervari/.rvm/gems/[email protected]/gems/
actionpack-3.1.0.rc1/lib/action_dispatch/middleware/templates/rescues/
_request_and_response.erb (0.9ms)
Rendered /home/egervari/.rvm/gems/[email protected]/gems/
actionpack-3.1.0.rc1/lib/action_dispatch/middleware/templates/rescues/
template_error.erb within rescues/layout (5.3ms)

Started GET “/trainingdividend/rest/myProfile/editPassword/” for
127.0.0.1 at 2011-05-30 16:29:06 -0400

ActionController::RoutingError (No route matches [GET] “/
trainingdividend/rest/myProfile/editPassword”):

Rendered /home/egervari/.rvm/gems/[email protected]/gems/
actionpack-3.1.0.rc1/lib/action_dispatch/middleware/templates/rescues/
routing_error.erb within rescues/layout (0.6ms)

This is the expected behavior, right? There is no method named
edit_user_password, so it’s raising an error.

Why is the route to this resource
“/trainingdividend/rest/myProfile/editPassword” ? And not something
like “/passwords/edit” or something else that is simpler and more
Rails-like? Is this a legacy application you’re dealing with? Just
trying to understand.

Bryan

I think it’s any syntax on the page now. It just happened that routes
were my common mistakes before I tested in a browser, but after some
more “what if” tests, I have had this problem come up in other
scenarios… so you can ignore my specific errors.

The last time this happened, my computer was essentially locked up - i
could barely move the mouse, type with the keyboard, etc. - for 3-5
minutes.

Firefox just kept trying to connect to Webrick… or it was waiting
for a response.

I’m going to try testing in chrome and see if that does anything…
maybe firefox is helping keep it alive or something.

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