0

我已经在服务器(Ubuntu 12.04 LTS)上安装了 redmine 2.1,它现在会产生 500 Server 错误消息。

我已配置为使用 apache 乘客并通过安装

xxxx:/usr/local/vhost/redmine# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]


gem --version
1.8.15


xxxxx:/usr/local/vhost/redmine/log# bundle --version
Bundler version 1.2.3


Started GET "/" for 217.247.62.52 at Sat Jan 05 13:39:34 +0000 2013
Processing by WelcomeController#index as HTML
Completed 500 Internal Server Error in 1ms

NoMethodError (undefined method `accept' for nil:NilClass):
  app/models/setting.rb:152:in `check_cache'
  app/controllers/application_controller.rb:82:in `user_setup'

我的 database.yml 适配器已经在 mysql2 上:

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: root
  password: *****
  encoding: utf8

但这似乎是错误的,因为我使用的是 ruby​​ 1.8.7 而不是1.9.X。

有人知道在哪里看吗?

更新 重试后,我从网站上的 passgen 收到以下消息:

Error message:
    no such file to load -- dispatcher
Exception class:
    LoadError
/var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb   251     in `require'
1   /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb   251     in `require'
2   /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb   236     in `load_dependency'
3   /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb   251     in `require'
4   /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    312     in `preload_application'
5   /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    252     in `initialize_server'
6   /usr/lib/ruby/1.8/phusion_passenger/utils.rb    255     in `report_app_init_status'
7   /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    237     in `initialize_server'
8   /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb  194     in `start_synchronously'
9   /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb  163     in `start'
10  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    213     in `start'
11  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    262     in `spawn_rails_application'
12  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb   126     in `lookup_or_add'
13  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    256     in `spawn_rails_application'
14  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb   80  in `synchronize'
15  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb   79  in `synchronize'
16  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    255     in `spawn_rails_application'
17  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    154     in `spawn_application'
18  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    287     in `handle_spawn_application'
19  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb  352     in `__send__'
20  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb  352     in `main_loop'
21  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb  196     in `start_synchronously'
22  /usr/lib/phusion_passenger/passenger-spawn-server
4

3 回答 3

4

正如@khmarbaise 所说,他的链接给了我解决方案:

在链接后面,我们发现Passenger现在将rails-application视为rack-application,因此apache2-config是:

RailsBaseURI /redmine

现在应该是

RackBaseURI /redmine

这使它对我有用(来源

于 2013-03-11T09:15:16.180 回答
1

在搜索了一段时间后,这部分是@Michael Witrant 的答案,我找到了以下链接,让我了解了正确的步骤。在使用 apache 配置中的推荐条目进行更改后,我将 database.yml 文件中的配置从 mysql2 更改为 mysql 适配器,它可以工作。

于 2013-01-05T14:20:13.587 回答
0

您可能遇到与此问题相同的问题:Rails 3: Model.all => NoMethodError: undefined method 'accept' for nil:NilClass

尝试使用mysql2适配器而不是mysqlin database.yml

于 2013-01-05T14:03:21.313 回答