redmine安装中的秘密生成因mysql2 / mysql2中的错误而失败

时间:2013-09-30 00:59:16

标签: ruby-on-rails redmine mysql2

我正在尝试在我的Debian vServer上安装redmine 2.3.x.我已经设法从源代码构建ruby并安装了gem,rails和apache乘客模块。它应该工作到那一点。我在domainfactory上使用了turotial:http://www.df.eu/de/service/df-faq/cloudserver/anleitungen/ruby-on-rails-installieren-debian-ubuntu/

之后,我按照此处所述下载并解压缩了redmine应用程序:http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Installation-procedure。我创建了一个mysql帐户和数据库,制作了config / database.yml.example的副本 - > config / database.yml并填入正确的值。

之后我用

安装了bundler
gem install bundler

继续准备环境:

bundle install --without development test

所有这些命令都成功了。

之后我想用fallowing命令生成秘密令牌:

rake generate_secret_token

执行因以下消息而中断:

 # rake generate_secret_token --trace
rake aborted!
cannot load such file -- mysql2/mysql2
/usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/var/www/potato/config/application.rb:7:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/var/www/potato/Rakefile:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

我试图通过检查版本和已安装的宝石来解决这个问题。

Ruby:ruby 2.0.0p247(2013-06-27修订版41674)[x86_64-linux]
Rails:Rails 3.2.13
宝石:1.8.25
Redmine:2.3.3

我使用gem list --local验证安装了gem“mysql2”。

gem“mysql”:mysql2(0.3.13)

由于问题似乎依赖于此,我尝试重新安装软件包,但这没有帮助。

我在这里错了什么?

提前致谢, 塞巴斯蒂安·比特纳

3 个答案:

答案 0 :(得分:1)

  1. 尝试bundle exec rake generate_secret_token

  2. (如果#1无效)检查bundle list的输出列表中是否显示了mysql2(与gem list不同!)。请注意database.yml中{red} install DB adapter according to你的设置(但我认为你正确安装)

答案 1 :(得分:1)

如果您没有在系统中安装以下软件包,我发现会发生此错误(至少在Debian 9上)。所以运行命令:

apt-get install default-libmysqlclient-dev

答案 2 :(得分:-1)

请检查您是否安装了必要的VC运行时。请检查VC运行时dll版本,你的mysql供应商dll是否依赖。