我在服务器(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
答案 0 :(得分:4)
正如@khmarbaise所说,他的链接给了我解决方案:
在链接后面我们发现Passenger现在将rails
- 应用程序视为rack
- 应用程序,因此apache2-config是:
RailsBaseURI /redmine
现在应该是
RackBaseURI /redmine
这使我的工作(source)
答案 1 :(得分:1)
部分是@Michael Witrant的答案,经过一段时间的搜索,我找到了以下link,这使我接受了正确的步骤。使用apache配置中的推荐条目更改后,我将配置从mysql2更改为database.yml文件中的mysql适配器,它可以正常工作。
答案 2 :(得分:0)
您可能遇到与此问题相同的问题:Rails 3: Model.all => NoMethodError: undefined method 'accept' for nil:NilClass
尝试在mysql2
中使用mysql
适配器而不是database.yml
。