Project

General

Profile

ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}):

Added by Alexey Yurganov almost 16 years ago

Hello, Redmine has some errors in production.log

ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}):
...

ActionController::RoutingError (No route matches "/stylesheets/jstoolbar.css" with {:method=>:get}):
...
ActionController::RoutingError (No route matches "/javascripts/prototype.js" with {:method=>:get}):
/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb:67:in `recognize_path'
/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:385:in `recognize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:148:in `handle_request'
...

-------------------------------------------------------------------------------------------------------------
Ubuntu 8.10
rails 2.2.2
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
Passenger 2.0.6
Redmine 0.8.0 RC1


Replies (9)

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Alexey Yurganov almost 16 years ago

I'm remove rails 2.2.2 and install 2.1.2 but it doesn't repair problems

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Alexey Yurganov almost 16 years ago

Ta-da number 2!

All worked after I add in /etc/apache2/sites-available/default follow strokes for my Vhost

<Directory /var/www/redmine/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

-----------------------------------
now it's look like:

<VirtualHost *:80>

ServerName redmine
ServerAlias *.redmine

DocumentRoot /var/www/redmine/public/

<Directory /var/www/redmine/public>

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

</Directory>

ErrorLog /var/log/apache2/redmine_errors.log
CustomLog /var/log/apache2/redmine_custom.log combined

</VirtualHost>

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Alexey Yurganov almost 16 years ago

Some noticed, all works well only then i install ruby and gem from rubyforge.com, install rails as gem not from apt-get, install mysql wrapper as gem not from apt-get, install passenger as gem not from apt-get(now in off rep version 2.03 but actually 2.0.6 )

Apache2 with php as fastcgi

Thx to Authors! Now will try Your product.

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Sam Bloomquist over 15 years ago

It's not clear to me from the replies on this post what the solution is. I am receiving similar errors after following the steps on RedmineUpgrade to upgrade my redmine instance to 0.8.0 on a Dreamhost shared server.

I tried uncommenting and updating the "config.action_controller.asset_host" property in config/environments/production.rb with no luck. Dreamhost recently upgraded all of their servers to Rails 2.2.2, but I don't think this should be the problem since rails is frozen into the vendor directory. The environment.rb file still specifies RAILS_GEM_VERSION as 2.1.2

Can you be more specific and clear about the steps you went through to get this fixed?

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Sam Bloomquist over 15 years ago

For me this turned out to be a problem with my public/.htaccess file. Maybe because Dreamhost uses Phusion Passenger for rails hosting? Anyway, here's what my working .htaccess file looks like now:

Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
# 
# Example:
#   ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Chris Williams over 15 years ago

I had the same problem with my Dreamhost account and changed my .htaccess file based on the comment above and that fixed it. I am using passenger for my deployment on Dreamhost.

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Anonymous over 15 years ago

I am getting the below error in redmine.I searched on net for this error some say its an error with the .htaccess file while some say wits with routes.rb.
I am not sure whats causing this error.I just have two extra plugins developed by me deployed with redmine0.8.3.(Rails -2.3.2 and Ruby 1.8.7 patch 11)

ActionController::RoutingError (No route matches "/ja <td style=" with {:method=>:get}):
/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb:67:in `old_recognize_path'
/vendor/plugins/reverse_proxy_fix/lib/reverse_proxy_fix.rb:96:in `recognize_path'
/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:385:in `recognize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:148:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:76:in `process'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `synchronize'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `process'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in `process_client'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `each'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `process_client'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `initialize'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `new'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `initialize'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `new'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:282:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in `each'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:128:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/command.rb:212:in `run'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281
/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `load'
/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
/vendor/rails/railties/lib/commands/server.rb:39
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/wamp/bin/ruby/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3

Rendering C:/wamp/apps/redmine-0.8.3/public/404.html (404 Not Found)

My .htaccess file has not been changed just that its as below:

  1. General Apache options
    <IfModule mod_fastcgi.c>
    AddHandler fastcgi-script .fcgi
    </IfModule>
    <IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
    </IfModule>
    <IfModule mod_cgi.c>
    AddHandler cgi-script .cgi
    </IfModule>
    Options +FollowSymLinks +ExecCGI
  1. If you don't want Rails to look in certain directories,
  2. use the following rewrite rules so that Apache won't rewrite certain requests
  3. Example:
  4. RewriteCond %{REQUEST_URI} ^/notrails.*
  5. RewriteRule .* - [L]
  1. Redirect all requests not available on the filesystem to Rails
  2. By default the cgi dispatcher is used which is very slow
  3. For better performance replace the dispatcher with the fastcgi one #
  4. Example:
  5. RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    RewriteEngine On
  1. If your Rails application is accessed via an Alias directive,
  2. then you MUST also set the RewriteBase in this htaccess file. #
  3. Example:
  4. Alias /myrailsapp /path/to/myrailsapp/public
  5. RewriteBase /myrailsapp

RewriteRule $ index.html [QSA]
RewriteRule ^([
.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
<IfModule mod_fastcgi.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_cgi.c>
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
</IfModule>

  1. In case Rails experiences terminal errors
  2. Instead of displaying this message you can supply a file here which will be rendered instead
  3. Example:
  4. ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

Can any one help me out with this...........

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by Ве Fio over 15 years ago

The solution for the original poster's problem is not to edit .htaccess, but to delete it. The default .htaccess rules in Rails are only for CGI/FCGI, they conflict with Passenger. See Passenger and Dreamhost documentation.

namita, you seem to be using Mongrel as a Rails server. The solution is the same, delete .htaccess. All the default .htaccess rules that used to come with Rails are only for people who are still serving Rails over CGI/FCGI, which is a bad idea anyway. Redmine should really leave that file out of the installation.

Also, Redmine 0.8.3 requires Rails 2.1.2, not 2.3.2. Either you have Rails 2.1.2 installed (check the list of installed Railses with gem list rails) or you changed the Rails version in config/environment.rb. If you changed the Rails version, change it back to 2.1.2 and install Rails 2.1.2:
gem install rails --VERSION=2.1.2
or install to vendor/rails:
rake rails:freeze:edge RELEASE=2.1.2

RE: ActionController::RoutingError (No route matches "/stylesheets/application.css" with {:method=>:get}): - Added by chetan muneshwar about 13 years ago

Rails base_uri /redmine not seems working :

Simple trick : cd /var/www/redmine/public/ && mkdir redmine && cd redmine/ && ln -sf ../javascripts javascripts && ln -sf ../stylesheets stylesheets && ln -sf ../images images .

All done

    (1-9/9)