Hi,
I could use some suggestions on how to get Rails running properly on a
Linux vserver running SuSE Linux Enterprise Server 10.
The application is not working as expected, on certain requests the
server dies. In the log file I see MySQL connection problems. I don't
have the MySQL gem installed so this is probably to be expected.
Assuming I really need this MySQL gem, the question is now how this
can be installed?
gem install mysql is not working:
user@epf:~> sudo gem install mysql
root's password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (x86_64-linux)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
3
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** 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.
In the readme of the gem some suggestions are offered for installing
this. These also don't work, for instance:
ruby extconf.rb
ruby extconf.rb --with-mysql-dir=/usr/bin
ruby extconf.rb --without-mysqlclientlib
I'm not sure, because when I do this:
rpm -ivh mysql-devel-5.0.26-14.x86_64.rpm
it reports and error:
error: Failed dependencies:
mysql-shared = 5.0.26 is needed by mysql-
devel-5.0.26-14.x86_64
I searched for 'libmysqlclient.so' on rpm.pbone.net and foundtwo rpm's
SuSE 10.X ftp.suse.com/pub/update/10.2/rpm/x86_64/mysql-
devel-5.0.26-14.x86_64.rpm
SuSE 10.X ftp.suse.com/pub/update/10.1/rpm/x86_64/mysql-
devel-5.0.26-12.13.x86_64.rpm
So I tried the one with the highest version number.
But I think I have it installed because when I do a global find on
'libmysqlclient' there are some hits:
epf:/home/user/migration/soft # find / -name 'libmysqlclient*'
/usr/lib64/mysql/libmysqlclient_r.so.15.0.0
/usr/lib64/mysql/libmysqlclient_r.so.15
/usr/lib64/mysql/libmysqlclient.so.15
/usr/lib64/mysql/libmysqlclient.so.15.0.0
/usr/lib64/libmysqlclient_r.so.15.0.0
/usr/lib64/libmysqlclient_r.so.15
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15.0.0
I'm not sure where my mysql dir is, the mysql exe is in /usr/bin and
it fails when I provide that directory:
epf:/home/user/migration/soft # sudo gem install mysql -- --with-mysql-
dir=/usr/bin
Select which gem to install for your platform (x86_64-linux)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
3
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql -- --with-mysql-dir=/usr/bin
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** 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.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
epf:/home/user/migration/soft #
Hi,
I am also getting same error. I tried all options but still error is
there.
Can anyone point me to correct answer?
I don't why the rails have this much of trouble.