Как установить rails 3.0 на Redhat 4.0 с поддержкой mysql2? - PullRequest
3 голосов
/ 27 октября 2010

При попытке установить rails 3.0 на сервере redhat 4.0 «установка комплекта» завершается неудачно во время установки mysql2.

Возможно ли это решить?

«установка комплекта»Команда возвращает следующий вывод:

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

Ответы [ 2 ]

0 голосов
/ 27 октября 2010

Да, но я полагаю, что он слишком старый?

~/rails/trial# rpm -qa|grep mysql
mysqlclient10-devel
mysqlclient10
mysql-devel
mysql-server
mysql

Однако, насколько кажется RHEL4, все кажется современным (и обновление на самом деле не вариант)

~/rails/trial# up2date --showall|grep mysql
mysql-4.1.22-2.el4_8.3.x86_64
mysql-bench-4.1.22-2.el4_8.3.x86_64
mysql-devel-4.1.22-2.el4_8.3.x86_64
mysql-server-4.1.22-2.el4_8.3.x86_64
mysqlclient10-3.23.58-4.RHEL4.1.x86_64
mysqlclient10-devel-3.23.58-4.RHEL4.1.x86_64

~/rails/trial# /usr/bin/mysql_config
Usage: /usr/lib64/mysql/mysql_config [OPTIONS]
Options:
    --cflags         [-I/usr/include/mysql -g -pipe -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing]
    --include        [-I/usr/include/mysql]
    --libs           [-L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto]
    --libs_r         [-L/usr/lib64/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib64 -lssl -lcrypto]
    --socket         [/var/lib/mysql/mysql.sock]
    --port           [3306]
    --version        [4.1.22]
    --libmysqld-libs [-L/usr/lib64/mysql -lmysqld -lz -lpthread -lcrypt -lnsl -lm -lpthread -lrt]
0 голосов
/ 27 октября 2010

У вас установлены все необходимые библиотеки для разработки?Например, libmysqlclient-16-dev или что-то подобное?

...