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

所有这些命令都成功了。

之后我想用下面的命令生成 secret token :

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
gem :1.8.25
红矿:2.3.3

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

gem "mysql": mysql2 (0.3.13)

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

我哪里做错了?

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

请您参考如下方法:

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

apt-get install default-libmysqlclient-dev


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!