Trouble installing Ruby mongrel/mysql/passenger on CentOS
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trouble installing Ruby mongrel/mysql/passenger on CentOS
I'm trying to install RubyOnRails, I'm at the point of installing the gem modules mongrel, mysql and passenger
Running
gem install mongrel
Returns
Code:
Building native extensions. This could take a while...
ERROR: Error installing mongrel:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for main() in -lc... 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. -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o http11_parser.o -c http11_parser.c
http11_parser.rl: In function 'http_parser_execute':
http11_parser.rl:105: warning: comparison between signed and unsigned
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. -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o http11.o -c http11.c
http11.c: In function 'http_field':
http11.c:77: error: 'struct RString' has no member named 'ptr'
http11.c:77: error: 'struct RString' has no member named 'len'
http11.c:77: warning: left-hand operand of comma expression has no effect
http11.c: In function 'header_done':
http11.c:172: error: 'struct RString' has no member named 'ptr'
http11.c:172: error: 'struct RString' has no member named 'ptr'
http11.c:172: error: 'struct RString' has no member named 'ptr'
http11.c:174: error: 'struct RString' has no member named 'ptr'
http11.c:176: error: 'struct RString' has no member named 'ptr'
http11.c:177: error: 'struct RString' has no member named 'len'
http11.c: In function 'HttpParser_execute':
http11.c:298: error: 'struct RString' has no member named 'ptr'
http11.c:299: error: 'struct RString' has no member named 'len'
make: *** [http11.o] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/ext/http11/gem_make.out
Running gem install mysql returns a similar result
Code:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for mysql_ssl_set()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-mysql-config
--without-mysql-config
/usr/local/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /usr/local/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:50:in `<main>'
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.8.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
And running gem install passenger returns
Code:
Successfully installed passenger-3.0.2
1 gem installed
Installing ri documentation for passenger-3.0.2...
Installing RDoc documentation for passenger-3.0.2...
ERROR: While executing gem ... (Encoding::UndefinedConversionError)
U+2019 from UTF-8 to ISO-8859-1
OK so I got rails/passenger etc. working with the latest versions but I'm now having difficulty getting the SQLite3 gem installed.
When I first tried installing it I got an error about not having the latest version so I downloaded the latest version and manually compiled it to /root/sqlite (And chmod'd/chown'd appropriately) then tried to install with
gem install sqlite3-ruby -- --with-sqlite3-dir=/root/sqlite
But now I'm getting the error
Code:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb --with-sqlite3-dir=/root/sqlite
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_next_stmt()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... 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_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION -I/root/sqlite/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o statement.o -c statement.c
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_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION -I/root/sqlite/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o exception.o -c exception.c
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_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION -I/root/sqlite/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o sqlite3.o -c sqlite3.c
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_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION -I/root/sqlite/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o database.o -c database.c
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_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION -I/root/sqlite/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o backup.o -c backup.c
gcc -shared -o sqlite3_native.so statement.o exception.o sqlite3.o database.o backup.o -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/root/sqlite/lib -Wl,-R/root/sqlite/lib -L. -rdynamic -Wl,-export-dynamic -lsqlite3 -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /root/sqlite/lib/libsqlite3.a(sqlite3.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/root/sqlite/lib/libsqlite3.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [sqlite3_native.so] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.2/ext/sqlite3/gem_make.out
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513
Rep:
The stable ruby 1.9.2p136 is stable in the way that you can use it,
when you write a new ruby application using the new included features.
But it may not work with all current ruby 'gems' / ruby applications ?
And : If you are not writing any ruby, an older version will do.
The stable ruby 1.9.2p136 is stable in the way that you can use it,
when you write a new ruby application using the new included features.
But it will not work with all current ruby 'gems' / ruby applications.
And : If you are not writing any ruby, an older version will do.
Ruby/Rails/Gems are installed successfully, the problem was with SQLite not ruby. Thanks for your help everyone but all I needed was to roll back to an older version of SQLite that was compatible with the gem.
-Sam
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.