当前位置: 代码迷 >> 综合 >> redmine ActionController::RoutingError (No route matches [GET] “/redmine“):
  详细解决方案

redmine ActionController::RoutingError (No route matches [GET] “/redmine“):

热度:43   发布时间:2024-02-04 18:11:18.0

redmine 配置好后

显示这个报错:

 

而用命令

sudo ruby bin/rails server webrick -e production 

可以正常显示:

报错的log为:


Started GET "/redmine" for 192.168.40.48 at 2020-07-31 17:43:54 +0800
ActionController::RoutingError (No route matches [GET] "/redmine"): 
actionpack (5.2.4.2) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'                       
actionpack (5.2.4.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'                        
railties (5.2.4.2) lib/rails/rack/logger.rb:38:in `call_app'                                         
railties (5.2.4.2) lib/rails/rack/logger.rb:26:in `block in call'                                    
activesupport (5.2.4.2) lib/active_support/tagged_logging.rb:71:in `block in tagged'                 
activesupport (5.2.4.2) lib/active_support/tagged_logging.rb:28:in `tagged'                     
activesupport (5.2.4.2) lib/active_support/tagged_logging.rb:71:in `tagged'                          
railties (5.2.4.2) lib/rails/rack/logger.rb:26:in `call'                                             
actionpack (5.2.4.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'                                     
actionpack (5.2.4.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'                       
rack (2.2.3) lib/rack/method_override.rb:24:in `call'                                                
rack (2.2.3) lib/rack/runtime.rb:22:in `call'                                                        
activesupport (5.2.4.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'      
pack (5.2.4.2) lib/action_dispatch/middleware/executor.rb:14:in `call'              
actionpack (5.2.4.2) lib/action_dispatch/middleware/static.rb:127:in `call'    
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'  
rack (2.2.3) lib/rack/content_length.rb:17:in `call'                                                                                                           
railties (5.2.4.2) lib/rails/engine.rb:524:in `call'

解决方法:

修改配置文件:

/etc/apache2/sites-available/000-default.conf

注意 <VirtualHost *:80> 这个要改成 <VirtualHost *:3000>

 

整体是这样的:

<VirtualHost *:3000>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

        ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


ServerName http://redmine.runaiot.com
DocumentRoot /public/redmine/public
<Directory /public/redmine/public>
AllowOverride all
Options -MultiViews
</Directory>

<Directory /var/www/html/redmine>
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

</VirtualHost>

  相关解决方案