Problem with Warbler - ActionController::RoutingError "No route matches"


#1

I’m having an issue with with my rails app, running with warbler in
tomcat.
Here the details:

  • OS: Windows XP (running in VMWare Fusion under mac os 10.4.11)
  • Tomcat 6.0.16
  • Java 1.6.0_5
  • Rails 2.1.1
  • Warbler 0.9.11

The warbler config is the default. The site was displayed correct (the
css
styles), but without the images. The images (and the css) are defined in
my
app/views/layout/application.html.erb as following:

<%= link_to(image_tag(“flag_de.gif”, :class => “flag”, :width => “18”,
:height => “12”), “#”) %> | <%= link_to(image_tag(“flag_uk.gif”, :class
=>
“flag”, :width => “18”, :height => “12”), “#”) %>

tomcat logs:

Processing SessionsController#login (for 127.0.0.1 at 2008-10-07
20:23:36)
[GET]
Session ID: 607889c60cf850f8e406965d738cab85
Parameters: {“controller”=>“sessions”, “action”=>“login”}
Rendering template within layouts/application
Rendering sessions/login
Completed in 0.22399 (4 reqs/sec) | Rendering: 0.08093 (36%) | DB:
0.00940
(4%) | 200 OK [http://localhost/myapp/login]

07.10.2008 20:23:36 org.apache.catalina.core.ApplicationContext log
INFO:

Processing ApplicationController#index (for 127.0.0.1 at 2008-10-07
20:23:36) [GET]
Session ID: 478a548f3ff7898566e7f8086fba98b5
Parameters: {}

ActionController::RoutingError (No route matches “/images/flag_uk.gif.”
with
{:method=>:get}):

/gems/gems/actionpack-2.1.1/lib/action_controller/routing/recognition_optimisation.rb:67:in
`recognize_path’

/gems/gems/actionpack-2.1.1/lib/action_controller/routing/route_set.rb:384:in
recognize' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:148:inhandle_request’
/gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:107:in
dispatch' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:104:indispatch’
/gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:35:indispatch’
file://lib/jruby-rack-0.9.2.jar!/rack/adapter/rails.rb:37:in
serve_rails' file://lib/jruby-rack-0.9.2.jar!/rack/adapter/rails.rb:44:incall’
file://lib/jruby-rack-0.9.2.jar!/jruby/rack/rails.rb:145:in call' file://lib/jruby-rack-0.9.2.jar!/rack/handler/servlet.rb:17:incall’
:1

Rendering
C:/Programme/Tomcat/webapps/carrierDB2.0/WEB-INF/gems/gems/actionpack-2.1.1/lib/action_controller/templates/rescues/layout.erb
(not_found)

07.10.2008 20:23:37 org.apache.catalina.core.ApplicationContext log
INFO:

Processing ApplicationController#index (for 127.0.0.1 at 2008-10-07
20:23:37) [GET]
Session ID: ed357aee21be4d908376076640f60370
Parameters: {}

ActionController::RoutingError (No route matches “/images/flag_de.gif.”
with
{:method=>:get}):

/gems/gems/actionpack-2.1.1/lib/action_controller/routing/recognition_optimisation.rb:67:in
`recognize_path’

/gems/gems/actionpack-2.1.1/lib/action_controller/routing/route_set.rb:384:in
recognize' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:148:inhandle_request’
/gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:107:in
dispatch' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:104:indispatch’
/gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:35:indispatch’
file://lib/jruby-rack-0.9.2.jar!/rack/adapter/rails.rb:37:in
serve_rails' file://lib/jruby-rack-0.9.2.jar!/rack/adapter/rails.rb:44:incall’
file://lib/jruby-rack-0.9.2.jar!/jruby/rack/rails.rb:145:in call' file://lib/jruby-rack-0.9.2.jar!/rack/handler/servlet.rb:17:incall’
:1

Rendering
C:/Programme/Tomcat/webapps/carrierDB2.0/WEB-INF/gems/gems/actionpack-2.1.1/lib/action_controller/templates/rescues/layout.erb
(not_found)

Do you have any idea, what was wrong?

Thx,
Christian

View this message in context:
http://www.nabble.com/Problem-with-Warbler---ActionController%3A%3ARoutingError-"No-route-matches"-tp19868181p19868181.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

We’ve seen this problem.

Not sure exactly what the problem is but a work around is to do the
following:

In your actionpack gem you can change line 477 of the
asset_tag_helper.rb
file to the following:

source += “.#{ext}” if (ext && File.extname(source).blank?) || (ext &&
File.exist?(File.join(ASSET_DIR, dir, “#{source}.#{ext}”)))

on windows there seems to be an issue with how the order of operations
is
working

Jay


#3

Hi Jay!

Thank you for your quick answer. This solution works for me (with a
little
change - the constant is ASSETS_DIR instead of ASSET_DIR)… :slight_smile:

You wrote “We’ve seen this problem.”. Do you know, whether a bug report
exists (may be as an improvement)?

Christian

Jay McGaffigan wrote:

File.exist?(File.join(ASSET_DIR, dir, “#{source}.#{ext}”)))
To: removed_email_address@domain.invalid

  • Java 1.6.0_5
    “flag”, :width => “18”, :height => “12”), “#”) %>
    Rendering template within layouts/application
    Parameters: {}
    /gems/gems/actionpack-2.1.1/lib/action_controller/routing/route_set.rb:384:i
    /gems/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:35:in
    lib/action_controller/templates/rescues/layout.erb

`recognize’
file://lib/jruby-rack-0.9.2.jar!/rack/adapter/rails.rb:37:in

Sent from the JRuby - User mailing list archive at Nabble.com.
Version: 8.0.173 / Virus Database: 270.7.5/1702 - Release Date: 10/6/2008


View this message in context:
http://www.nabble.com/Problem-with-Warbler---ActionController%3A%3ARoutingError-"No-route-matches"-tp19868181p19878168.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

Sorry for the typo.

Here are some links to some information about it:
http://rails.lighthouseapp.com/projects/8994/tickets/1085-asset_tag_helperrb
-expression-bug-in-compute_public_path

http://rails.lighthouseapp.com/projects/8994/tickets/440-windows-file-loadin
g

From reading the first link it looks like Rails was patched on the edge
just
the other day.

Jay