3

我正在尝试在我的 Debian vServer 上安装 redmine 2.3.x。我已经设法从源代码构建 ruby​​ 并安装了 gems、rails 和 apache 乘客模块。它应该工作到那个时候。我在 domainfactory 使用了教程: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 并填写了正确的值。

之后我安装了捆绑器

gem install bundler

并继续准备环境:

bundle install --without development test

所有这些命令都成功了。

之后,我想使用以下命令生成秘密令牌:

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>'

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

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

我验证gem list --local了 gem "mysql2" 已安装。

宝石“mysql”:mysql2(0.3.13)

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

我在这里做错了什么?

在此先感谢,塞巴斯蒂安·布特纳

4

3 回答 3

1
  1. 尝试bundle exec rake generate_secret_token

  2. (如果 #1 没有帮助)检查 mysql2 是否出现在输出列表中bundle list(它与gem list! 不同)。请注意 redmine根据您的设置安装 DB 适配器database.yml(但我认为您安装正确)

于 2013-09-30T08:06:34.863 回答
1

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

apt-get install default-libmysqlclient-dev

于 2018-05-18T14:21:06.330 回答
-1

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

于 2017-10-21T19:22:11.233 回答