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

标签 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>

我完全被难住了。我自己就是一个 php 人...

运行 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)

最佳答案

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

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

更新

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

关于mysql - 您的 config/database.yml 可能编写不正确。请检查并修复任何错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18804665/

相关文章:

ruby-on-rails - 为什么正则表达式不能匹配@符号?

ruby-on-rails - 为什么一个没有值的变量会返回 true 和 empty?在 View 中使用时)?

python-redmine 按版本截止日期过滤问题

sql - 如何有效地 SQL 从 MySQL 数据库中选择最新的条目?

ruby-on-rails - 使用 RSpec 3 在 block 之前运行一次

MySQL - 有没有办法检查一个 View 是否被其他 View 引用?

mysql - 如何将版本从 bugzilla 迁移到 redmine 中新的自定义 'source version' 字段(我需要什么 SQL 语法)?

ruby-on-rails - 为什么我无法在 Redmine 中添加新问题?

mysql - 如何调查和优化缓慢的 MySQL 查询?

mysql - 如何将逗号分隔值传递给 MySql 中的存储过程?