0

我正在尝试在我的共享 DreamHost 帐户上部署一个非常简单的 Rails 应用程序,但被卡住了。日志输出似乎没有告诉我出了什么问题。

当我在浏览器中访问应用程序的任何资源时,它会返回标准的 404 错误页面 (public/404.html)。log/production.log 文件中的所有内容:

Started GET "/" for 198.144.202.78 at Wed Aug 15 14:34:58 -0700 2012 Processing by HomeController#index as HTML   Rendered home/index.html.erb within layouts/application (5.3ms)


Started GET "/internal_error.html" for 198.144.202.78 at Wed Aug 15 14:34:58 -0700 2012

ActionController::RoutingError (No route matches [GET] "/internal_error.html"):
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.8) lib/rails/engine.rb:479:in `call'
  railties (3.2.8) lib/rails/application.rb:223:in `call'
  railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `send'
  railties (3.2.8) lib/rails/railtie/configurable.rb:30:in `method_missing'
  /dh/passenger/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  /dh/passenger/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  /dh/passenger/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
  /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:170:in `send'
  /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:170:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/utils.rb:479:in `safe_fork'
  /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:180:in `start'
  /dh/passenger/lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  /dh/passenger/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
  /dh/passenger/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  /dh/passenger/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  /dh/passenger/helper-scripts/passenger-spawn-server:99

据我了解,报告的唯一错误是它找不到要重定向到的“internal_error.html”页面。(尽管我确实在 public/internal_error.html 上创建了一个 - 这没有帮助)。在任何情况下,它都不会告诉我它遇到了什么错误(这是我正在寻找的)。我在 config/environments/production.rb 中设置了 config.log_level = :debug。

apache 错误日志(~/logs/MY_DOMAIN/http/error.log)只说:

[Wed Aug 15 14:34:58 2012] [error] [client 198.144.202.78] Premature end of script headers:

无论如何,这是我的 Gemfile:

source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'mysql2'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
#  gem 'coffee-rails', '~> 3.2.1'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'ruby-debug'
gem "rake", "0.8.7"
#gem "rmagick"
# gem "rmagick", ">= 1.15", :require => 'RMagick'
gem "rmagick", "1.15.14", :require => 'RMagick'
gem "carrierwave"
gem "therubyracer"

关于环境的一些细节:

rails - 使用 ~/.gems/bin/rails 版本 3.2.8 ruby​​ - 据我所知,使用 /usr/bin/ruby 版本 1.8.7 rake - 使用 /usr/lib/ruby/gems/1.8/bin/ /rake 版本 0.8.7

我能够成功运行 bundle 和 rake db:migrate (在跳过很多圈之后)。

4

0 回答 0