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

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>

也要把命令输入上:

sudo ruby bin/rails server webrick -e production 

 

整体是这样的:

<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>
 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值