简体   繁体   English

Rails + Ubuntu + MySQL =错误

[英]Rails + Ubuntu + MySQL = Error

I have XAMPP installed on Ubuntu 12.04 and it all works. 我在Ubuntu 12.04上安装了XAMPP,并且一切正常。 I've also been using Rails for a while with PostgreSQL and it also worked fine. 我在PostgreSQL上使用Rails已有一段时间了,它也运行良好。

Today, I tried creating a new app using mysql with mysql2 gem, and got an error while running rake db:create . 今天,我尝试使用带有mysql2 gem的mysql创建一个新应用,并在运行rake db:create出错。

I first checked the other Rails/MySQL questions on SO, and will say: 我首先检查了SO上的其他Rails / MySQL问题,然后说:

  1. MySQL is running MySQL正在运行
  2. Using mysql2 gem 使用mysql2 gem
  3. DB config looks correct (to me) 数据库配置看起来正确(对我而言)
  4. database.yml using socket: /opt/lampp/var/mysql/mysql.sock 使用socket: /opt/lampp/var/mysql/mysql.sock database.yml socket: /opt/lampp/var/mysql/mysql.sock

Error: 错误:

/opt/lampp/lib/libmysqlclient.so.18: symbol SSL_accept, version OPENSSL_1.0.1 not defined in file libssl.so.1.0.0 with link time reference - /home/wwc/.rvm/gems/ruby-2.0.0-p353/extensions/x86_64-linux/2.0.0/mysql2-0.3.14/mysql2/mysql2.so
/home/wwc/.rvm/gems/ruby-2.0.0-p353/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
/home/wwc/.rvm/gems/ruby-2.0.0-p353/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top (required)>'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/wwc/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/media/fat64/work/_active/josephzidell_rails/config/application.rb:7:in `<top (required)>'
/media/fat64/work/_active/josephzidell_rails/Rakefile:4:in `require'
/media/fat64/work/_active/josephzidell_rails/Rakefile:4:in `<top (required)>'
/home/wwc/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/home/wwc/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'

You can try installing SSL libs using: 您可以尝试使用以下方法安装SSL库:

apt-get install libssl-dev

You can check the path that it has been installed in using: 您可以使用以下方法检查它的安装路径:

apt-file list libssl-dev

you may need to install apt-file first by running: 您可能需要先运行以下命令来安装apt-file:

sudo apt-get install apt-file
apt-file update

The Ruby 2.0.0 got problem with OpenSSL 1.0.1f Ruby 2.0.0遇到了OpenSSL 1.0.1f的问题

Check How can I ensure that Ruby uses an OpenSSL not vulnerable to Heartbleed? 检查我如何确保Ruby使用不受Heartbleed影响的OpenSSL? and you will realize that your Ruby's OpenSSL lib is not up-to-date 并且您将意识到您的Ruby的OpenSSL库不是最新的

Follow these command (credit: https://coderwall.com/p/tptocq ) rvm pkg install openssl rvm install 2.0.0 \\ --with-openssl-dir=$HOME/.rvm/usr \\ --verify-downloads 1 请遵循以下命令(信贷: https ://coderwall.com/p/tptocq)rvm pkg install openssl rvm install 2.0.0 \\ --with-openssl-dir = $ HOME / .rvm / usr \\ --verify-downloads 1

The new installed Ruby 2.0.0 on your machine will got the final OpenSSL version (1.0.1g), which also patched for the Heart Bleed. 您计算机上新安装的Ruby 2.0.0将获得最终的OpenSSL版本(1.0.1g),该版本也针对Heart Bleed进行了修补。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM