如何在 Redhat 4.0 上安装支持 mysql2 的 Rails 3.0?
当尝试在 Redhat 4.0 服务器上安装 Rails 3.0 时,“bundle install”在安装 mysql2 期间失败。
有可能解决这个问题吗?
“bundle install”命令返回以下输出:
~/rails/trial# bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.0)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.0)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.6.1)
Using actionmailer (3.0.0)
Using arel (1.0.1)
Using activerecord (3.0.0)
Using activeresource (3.0.0)
Using bundler (1.0.3)
Installing mysql2 (0.2.4) with native extensions /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/local/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -g -pipe -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fPIC -O3 -ggdb -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wall -funroll-loops -o client.o -c client.c
In file included from ./mysql2_ext.h:29,
from client.c:1:
./client.h:41:7: warning: no newline at end of file
client.c: In function `set_reconnect':
client.c:434: error: `MYSQL_OPT_RECONNECT' undeclared (first use in this function)
client.c:434: error: (Each undeclared identifier is reported only once
client.c:434: error: for each function it appears in.)
client.c: In function `set_connect_timeout':
client.c:451: warning: passing arg 3 of `mysql_options' from incompatible pointer type
make: *** [client.o] Error 1
Gem 文件将保留安装在 /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4 中以供检查。
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4/ext/mysql2/gem_make.out
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/source.rb:100:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:55:in `block in run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `block in each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:44:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:8:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/cli.rb:221:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/bin/bundle:13:in `<top (required)>'
from /usr/local/bin/bundle:19:in `load'
from /usr/local/bin/bundle:19:in `<main>'
When trying to install rails 3.0 on a redhat 4.0 server, the 'bundle install' fails during the installation of mysql2.
Is it possible to solve this?
'bundle install' command returns the following output:
~/rails/trial# bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.0)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.0)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.0)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.6.1)
Using actionmailer (3.0.0)
Using arel (1.0.1)
Using activerecord (3.0.0)
Using activeresource (3.0.0)
Using bundler (1.0.3)
Installing mysql2 (0.2.4) with native extensions /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/local/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -g -pipe -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fPIC -O3 -ggdb -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wall -funroll-loops -o client.o -c client.c
In file included from ./mysql2_ext.h:29,
from client.c:1:
./client.h:41:7: warning: no newline at end of file
client.c: In function `set_reconnect':
client.c:434: error: `MYSQL_OPT_RECONNECT' undeclared (first use in this function)
client.c:434: error: (Each undeclared identifier is reported only once
client.c:434: error: for each function it appears in.)
client.c: In function `set_connect_timeout':
client.c:451: warning: passing arg 3 of `mysql_options' from incompatible pointer type
make: *** [client.o] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4/ext/mysql2/gem_make.out
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/source.rb:100:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:55:in `block in run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `block in each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:44:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:8:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/cli.rb:221:in `install'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/bin/bundle:13:in `<top (required)>'
from /usr/local/bin/bundle:19:in `load'
from /usr/local/bin/bundle:19:in `<main>'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否安装了所有合适的开发库?例如 libmysqlclient-16-dev 或类似的东西?
Do you have all the appropriate development libraries installed? E.g.
libmysqlclient-16-dev
or something like that?是的,但我相信它太旧了?
然而,就 RHEL4 而言,一切似乎都是最新的(并且升级并不是真正的选择)
Yes, but I believe it is too old?
However everything seems up to date as far as RHEL4 gets (and upgrading isn't really an option)