Ruby on rails 为什么Rails 4.2.1在生产中寻找index.html(apache2,乘客)
我在生产中部署了以下软件堆栈: 轨道4.2.1 阿帕奇2 乘客5.0.13 这是通过浏览器请求应用程序时production.log上的错误: [2015-07-12T17:22:23.089940#5378]信息--:开始获取 2015年7月12日17:22:23+0000华氏度10.0.0.89的“/index.html”, [2015-07-12T17:22:23.090858#5378]致命-- ActionController::RoutingError(没有与[GET]“/index.html”匹配的路由): actionpack(4.2.1) lib/action\u dispatch/middleware/debug\u exceptions.rb:21:inRuby on rails 为什么Rails 4.2.1在生产中寻找index.html(apache2,乘客),ruby-on-rails,ruby,ubuntu,passenger,apache2.2,Ruby On Rails,Ruby,Ubuntu,Passenger,Apache2.2,我在生产中部署了以下软件堆栈: 轨道4.2.1 阿帕奇2 乘客5.0.13 这是通过浏览器请求应用程序时production.log上的错误: [2015-07-12T17:22:23.089940#5378]信息--:开始获取 2015年7月12日17:22:23+0000华氏度10.0.0.89的“/index.html”, [2015-07-12T17:22:23.090858#5378]致命-- ActionController::RoutingError(没有与[GET]“/index
call'
actionpack(4.2.1)
lib/action\u dispatch/middleware/show\u exceptions.rb:30:in
call'railties(4.2.1)lib/rails/rack/logger.rb:38:in
call_app'railties
(4.2.1)lib/rails/rack/logger.rb:20:in
block in call'activesupport
(4.2.1)lib/active_support/taged_logging.rb:68:inblock in taged'
activesupport(4.2.1)lib/active\u support/taged\u logging.rb:26:in
taged'activesupport(4.2.1)
lib/active_support/tagged_logging.rb:68:intagged'railties(4.2.1)
lib/rails/rack/logger.rb:20:in
call'actionpack(4.2.1)
lib/action\u dispatch/middleware/request\u id.rb:21:incall'rack
(1.6.4)lib/rack/methodoverride.rb:22:in
call'rack(1.6.4)
lib/rack/runtime.rb:18:incall'activesupport(4.2.1)
lib/active\u support/cache/strategy/local\u cache\u middleware.rb:28:in
call'rack(1.6.4)lib/rack/sendfile.rb:113:incall'railties
(4.2.1)lib/rails/engine.rb:518:in
call'railties(4.2.1)
lib/rails/application.rb:164:incall'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.13/lib/phusion\u passenger/rack/thread\u handler\u extension.rb:94:in
处理请求'/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.13/lib/phusion\u passenger/request\u handler/thread\u handler.rb:149:in
accept\u and\u process\u next\u request'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.13/lib/phusion\u passenger/request\u handler/thread\u handler.rb:110:in
main\u loop'/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.13/lib/phusion\u passenger/request\u handler.rb:415:in 开始线程中的
块(3级)'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p643/gems/passenger-5.0.13/lib/phusion\u passenger/utils.rb:111:in
在创建线程和异常时中止
我的配置/routes.rb如下所示:
Rails.application.routes.draw do
root 'sessions#new'
# - Session Resources - #
resources :sessions, only: [:new, :create, :destroy]
resources :password_resets
end
在开发过程中,根页面会相应地被提供,但在生产过程中,会出现带有上述错误的空白屏幕
请协助。您是否有.htaccess文件,如果有,其内容是什么?您确定已将最新更新部署到服务器,对吗?有没有可能它部署失败,而您正试图路由到一个不存在的index.html?我在配置中没有.htaccess文件。@mike是的,我确实通过capistrano3.4.0部署了应用程序,没有引发任何错误。请检查“RAILS\u ENV=production rake routes”和“RAILS\u ENV=development rake routes”,配置文件中可能缺少一些内容。您是否有.htaccess文件,如果有,它的内容是什么?您确定已将最新更新部署到服务器,对吗?有没有可能它部署失败,而您正试图路由到一个不存在的index.html?我在配置中没有.htaccess文件。@mike是的,我确实通过capistrano3.4.0部署了应用程序,没有抛出任何错误。请检查“RAILS\u ENV=production rake routes”和“RAILS\u ENV=development rake routes”,配置文件中可能缺少某些内容。