# Routing error when including javascript

**URL:** <https://www.ruby-forum.com/t/routing-error-when-including-javascript/106645>\
**Category:** Rails\
**Created:** [June 12, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/routing-error-when-including-javascript/106645 "2007-06-12T20:06:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 12, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/routing-error-when-including-javascript/106645/1 "2007-06-12T20:06:59Z")

</div>

Hi all -

I’m trying to use a javascript library in my rails app and I’m getting  
a routing error that I can’t seem to fix. I’m using rails 1.2.3, and  
all restful routing. In my layout file, I have the following line:

\<%= javascript\_include\_tag “external” %\>

then in #RAILS\_ROOT/public/javascripts I have a file called  
“external.js”.

When I try to load the page in question, I get this error in my log:

ActionController::RoutingError (no route found to match “/javascripts/  
external.js” with {:method=\>:get}):  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/routing.rb:1292:in `recognize_path' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/routing.rb:1282:in`recognize’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:  
40:in `dispatch' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ rails.rb:78:in`process’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
rails.rb:76:in `synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ rails.rb:76:in`process’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:  
618:in `process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb: 617:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:  
617:in `process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb: 736:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:  
736:in `initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb: 736:in`new’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:  
736:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb: 720:in`initialize’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:  
720:in `new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb: 720:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
configurator.rb:271:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/ configurator.rb:270:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
configurator.rb:270:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails: 127:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/  
command.rb:211:in `run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails: 243 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:488:in`load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/dependencies.rb:488:in `load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:342:in`new\_constants\_in’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/dependencies.rb:488:in `load' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ mongrel.rb:60 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:495:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/dependencies.rb:342:in `new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:495:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/  
server.rb:39  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
script/server:3

Is this normal? I guess it makes sense, given that Javascript pulls  
include files in via HTTP, but I’m a little unsure what the best way  
to solve this is.

Any tips or suggestions would be greatly appreciated…thanks!

Josh

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 12, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/routing-error-when-including-javascript/106645/2 "2007-06-12T20:15:59Z")

</div>

This looks more like a web server issue than a rails issue. It should  
not even get to the routing if the web server can find the file.

Check your web server config and make sure the file cases match if you  
are on a case sensitive server.

Michael

On Jun 12, 11:06 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 12, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/routing-error-when-including-javascript/106645/3 "2007-06-12T20:33:04Z")

</div>

Hi -

Thanks for the quick reply. This is still in development right now,  
so I’m just using mongrel locally at the moment. I’m a bit new to all  
this, so I’m not sure where to look next. Do I need to setup a web  
server in my dev environment to get this error to go away?
