Rails 3 on CentOS - problems with mysql2 gem?



那么有人能够在CentOS上成功运行Rails 3.2吗?我们看到的问题是:

[root@scglobal-web01 current]# rails c
/var/www/html/webapps/intl-custserv/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': Incorrect MySQL client library version! This gem was compiled for 5.5.15 but the client library is 5.0.92. (RuntimeError)
    from /var/www/html/webapps/intl-custserv/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'


这里有一些关于我们环境的详细信息:

[root@scglobal-web01 ~]# cat /etc/redhat-release
CentOS release 5.7 (Final)
[root@scglobal-web01 ~]# mysql --version
mysql  Ver 14.14 Distrib 5.5.13, for Linux (x86_64) using readline 5.1  
[root@scglobal-web01 ~]# rvm list
rvm rubies
   jruby-1.6.7 [ amd64 ]
   ruby-1.8.7-p358 [ x86_64 ]
=* ruby-1.9.3-p125 [ x86_64 ]
# => - current
# =* - current && default
#  * - default
[root@scglobal-web01 ~]# gem list --local
*** LOCAL GEMS ***
actionmailer (3.2.2)
actionpack (3.2.2)
activemodel (3.2.2)
activerecord (3.2.2)
activeresource (3.2.2)
activesupport (3.2.2)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.0, 1.0.22)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
daemon_controller (1.0.0)
erubis (2.7.0)
execjs (1.3.0)
fastthread (1.0.7)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.1)
json (1.6.5)
mail (2.4.3)
mime-types (1.17.2)
multi_json (1.1.0)
mysql2 (0.3.11)
passenger (3.0.11)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.2)
railties (3.2.2)
rake (0.9.2.2, 0.9.2)
rdoc (3.12)
sass (3.1.15)
sass-rails (3.2.4)
sprockets (2.1.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.32)
uglifier (1.2.3)
[root@scglobal-web01 ~]#


以下也是一些(可能)相关文件所在的位置:

[root@scglobal-web01 ~]# whereis mysql_config
mysql_config: /usr/bin/mysql_config /usr/share/man/man1/mysql_config.1.gz
[root@scglobal-web01 ~]# ls -al /usr/lib64/mysql
total 14988
drwxr-xr-x  3 root root     4096 Mar  7 22:59 .
drwxr-xr-x 44 root root    24576 Mar  7 23:15 ..
-rw-r--r--  1 root root   120260 May 11  2011 libmygcc.a
-rw-r--r--  1 root root 15148296 May 11  2011 libmysqlclient.a
lrwxrwxrwx  1 root root       16 Mar  7 22:59 libmysqlclient_r.a -> libmysqlclient.a
-rw-r--r--  1 root root    10000 May 11  2011 libmysqlservices.a
drwxr-xr-x  3 root root     4096 Mar  7 22:20 plugin
[root@scglobal-web01 ~]#


如有任何见解,我们将不胜感激!

感谢

我也有同样的问题。

运行于:

  • CentOS 6.3版(最终版)
  • mysql版本14.14 Distrib 5.5.28,适用于使用readline 5.1的Linux(x86_64)
  • rvm和ruby 1.9.3

到目前为止,我已经了解到mysql-devel包适用于mysql5.0.x,而不是5.5

我需要用新软件包重新安装gem。但是到目前为止我还不能做到

标志是

$ sudo yum install mysql-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.linuxwerk.com
 * epel: mirrors.n-ix.net
 * extras: mirror.jgotteswinter.com
 * updates: mirror.optimate-server.de
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-devel.x86_64 0:**5.1.69**-1.el6_4 will be installed

在我们安装好之后。捆绑安装效果良好,安装0.3.13。然后我们回到:

$rails c
...../gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require': Incorrect MySQL client library version! This gem was compiled for 5.1.69 but the client library is 5.5.28. (RuntimeError)

最新更新