您的config / database.yml可能无法正确编写。请检查并修复任何错误

时间:2013-09-14 17:50:03

标签: mysql ruby-on-rails redmine

我正在尝试在Ubuntu系统上安装redmine,我相信它应该正常运行。但它似乎陷入了困境:

Your config/database.yml may not be written correctly. Please check it and fix any errors.
Your database schema may be out of date or nonexistant. Please run rake db:migrate to ensure that the database schema is up-to-date.
The database server may not be running. Please check whether it's running, and start it if it isn't.

我的database.yml设置正确,mysql正在运行且凭据正确无误。

production:
adapter: mysql
database: myredminedb
host: localhost
username: redmine
password: password
encoding: utf8w

目前在http://track.hutber.com/使用单独的虚拟主机:

<VirtualHost *:80>
        DocumentRoot /var/www/hutber.com/track.hutber.com
        ServerName track.hutber.com

    <Directory /var/www/hutber.com/track.hutber.com>
       Options FollowSymLinks
       RailsBaseURI /usr/share/redmine
       PassengerResolveSymlinksinDocumentRoot on               
       AllowOverride None
     </Directory>
</VirtualHost>

我完全难过了。我自己就是个骗子......

运行rake db:migrate

RAILS_ENV=production rake db:migrate
(in /usr/share/redmine)
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/share/redmine/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /usr/share/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
Please install RDoc 2.4.2+ to generate documentation.
Character set 'utf8w' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
rake aborted!
Can't initialize character set utf8w (path: /usr/share/mysql/charsets/)

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

1 个答案:

答案 0 :(得分:1)

您需要在应用程序根目录中运行rake db:migrate。那将是包含文件Rakefile的目录。从你的问题的细节不确定,但我猜你需要这样做:

cd /var/www/hutber.com/track.hutber.com
RAILS_ENV=production rake db:migrate

<强>更新

并将database.yml中的字符集更改为utf8。它目前设置为utf8w