LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-16-2011, 09:01 AM   #1
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Rep: Reputation: 0
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
ruby -v is
Code:
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
and gem -v is
Code:
1.3.7
rails -v is
Code:
Rails 3.0.3
-Sam
 
Old 01-16-2011, 12:12 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Ruby-1.9.2p136 : May be not OK for the gem packages ?
Fedora 14 has ruby-1.8.7.302.
The upcoming Fedora 15 has currently 1.8.7.330.


How about installing ' el5 ' packages ? CentOS 5 has ruby-1.8.5 :

1) # yum search <name> ( or part of name.)

2) # yum install ruby-mysql rubygem-rails rubygem-mongrel <etc.> <etc.>
3) # gem install passenger

The base repo will supply nine ruby packages. The EPEL repo : 60 packages.
Then you are sure to get packages that work on CentOS 5.


EPEL, Extra Packages for Enterprise Linux https://fedoraproject.org/wiki/EPEL
https://fedoraproject.org/wiki/EPEL/FAQ#howtouse

..
 
Old 01-16-2011, 02:17 PM   #3
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 0
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
-Sam
 
Old 01-17-2011, 07:28 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
OK, Debian Sid ( x86_64 ) has 'ruby-1.9.1' ( from ruby1.9.1_1.9.2.0.orig.tar.gz)
.. and I can try out some stuff :

# apt-get install mongrel libsqlite3-ruby1.9.1
# gem install sqlite3

No problems with this Ruby 1.9.1**, may be you just need a "stable" version ?
http://packages.debian.org/sid/ruby1.9.1-full

..
 
Old 01-17-2011, 01:45 PM   #5
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
OK, Debian Sid ( x86_64 ) has 'ruby-1.9.1' ( from ruby1.9.1_1.9.2.0.orig.tar.gz)
.. and I can try out some stuff :

# apt-get install mongrel libsqlite3-ruby1.9.1
# gem install sqlite3

No problems with this Ruby 1.9.1**, may be you just need a "stable" version ?
http://packages.debian.org/sid/ruby1.9.1-full

..
I'm on CentOS/Redhat so I can't use Debian packages and both Ruby and SQLITE3 are the latest stable versions
 
Old 01-19-2011, 10:43 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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 reason to show the Debian [ruby1.9.1_1.9.2.0.orig.tar.gz] is
just to let you know a version, that works with all the old gems, etc.
Basically a '1.9.1', but with features from '1.9.2' included.
The 27 required patches : [ruby1.9.1_1.9.2.0-2.debian.tar.gz]

..

Last edited by knudfl; 01-19-2011 at 02:09 PM.
 
Old 01-19-2011, 01:56 PM   #7
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
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.

The reason to show the Debian [ruby1.9.1_1.9.2.0.orig.tar.gz] is
just to let you know a version, that works with all the old gems, etc.
Basically a '1.9.1', but with features from '1.9.2' included.
The 27 required patches : [ruby1.9.1_1.9.2.0-2.debian.tar.gz]

..
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "/etc/init.d/apache2" start VS "apache2ctl start" with passenger module (ruby/rails) arond Linux - Server 1 12-13-2010 10:56 AM
Error while installing MySQL Ruby gem skie_knite007 Programming 5 07-12-2009 06:57 PM
Help needed installing Ruby MySQL DBI bostonantifan Linux - Software 1 11-12-2007 04:03 AM
Help needed installing Ruby MySQL DBI bostonantifan Ubuntu 0 11-11-2007 09:35 AM
Installing ruby with rails+mysql+apache on Slackware 10.2 from source paultoytoy Slackware 1 09-08-2006 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration