Open jarrettchisholm opened 11 years ago
@jarrettchisholm the gem depends on mysql installed and having ssl functionality.
Please provide the contents of mkmf.log
around the lines of checking for mysql_ssl_set()...
mkmf.log is empty when I look in it...
@jarrettchisholm ah, I see this:
/home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
Do you have gcc and all the development tools installed? Silly question since you're using RVM, but dunno if you're using precompiled binaries or not.
I'm not sure if you're using Ubuntu or what, but you check rvm requirements
I believe will give you the list of things you need to install.
all requirements are installed:
build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
I've been unsuccessful so far, so I followed these instructions to get openssl 0.9.8 installed (http://stackoverflow.com/questions/13366409/undefined-symbol-sslv2-method-when-trying-to-run-thin-webserver and https://rvm.io/packages/openssl/), and then installed the mysql2
gem and used that instead. Seems to work with mysql2
ok. Still can't get the mysql
gem to compile (even with openssl 0.9.8 installed locally through rvm).
@jarrettchisholm did you build the version of Ruby you have installed? or is using the binary packages?
Also, is failing to find the compiler, which might be caused by something else interfering in your system.
Have you tried a newer version of Ruby? 1.9.1 seems long ago (and perhaps there is a bug we are not seeing)
Last but no least, in any of the links (or here) you have provided information of which distro (and version) are you using, neither which version of mysql and mysql dev packages you have installed.
Built version of ruby. I've tried Ruby 1.9.1, 1.9.2, and 1.9.3.
aptitude versions mysql-client libmysqlclient-dev libmysql++-dev ruby-mysql libmysql-ruby
Package libmysql-ruby:
i 2.8.2+gem2deb-3 testing 500
Package libmysql-ruby1.8:
p 2.8.2+gem2deb-3 testing 500
Package libmysql-ruby1.9.1:
p 2.8.2+gem2deb-3 testing 500
Package libmysqlclient-dev:
p A 5.5.30+dfsg-1.1 testing 500
i A 5.5.30-rel30.2-500.squeeze unstable 500
Package libmysqlclient-dev:i386:
p 5.5.30+dfsg-1.1 testing 500
p 5.5.30-rel30.2-500.squeeze unstable 500
Package mysql-client:
i 5.5.30+dfsg-1.1 testing 500
Package mysql-client-5.5:
i A 5.5.30+dfsg-1.1 testing 500
Package mysql-client-5.5:i386:
p 5.5.30+dfsg-1.1 testing 500
Package ruby-mysql:
i 2.8.2+gem2deb-3 testing 500
Package ruby-mysql:i386:
p 2.8.2+gem2deb-3 testing 500
Ok, first thing first: you're trying to use libmysql-ruby
package, but that doesn't work with Ruby installed by RVM.
I'm getting confused on what are you trying to accomplish and how are you trying to accomplish it.
You don't need any of the *-ruby
packages since The ruby versions you have installed are not the ones provided by the OS packages.
Now, What mkmf is reporting when installing the gem is clear:
`try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
It is failing to locate compilers and tools required to compile.
You said before you have all installed, but seems is not working.
Are you 100% sure that there is no mkmf.log file in the gem directory? There should be one at /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1/ext/mysql_api/mkmf.log
Just trying to install the mysql gem.
Sorry, I posted some other libraries which might not be required - I basically chose a shotgun approach, and installed anything that might be ruby/mysql related.
I'm fairly convinced that it has to do with openssl 1.0.0
being installed on debian testing (to be the new 7 I believe), where openssl 0.9.8
is required by the gem (or one of its dependencies).
I've checked for the mkmf.log
(at /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1/ext/mysql_api/mkmf.log
), and it exists, it is just empty.
I'm fairly convinced that it has to do with openssl 1.0.0 being installed on debian testing (to be the new 7 I believe), where openssl 0.9.8 is required by the gem (or one of its dependencies).
No, the gem doesn't require openssl, perhaps is a dependency of libmysqlclient, but is not directly linked to Ruby.
As I mentioned before: it is failing way early in the compile process, and is telling you there is no compiler available.
Can you try something? can you attempt to install other gem like mysql2? or even better, a complete unrelated one like json, RedCloth or rdiscount?
Let me know if that works, because from what I see above, it shouldn't (in theory).
hey @luislavena, hmmm...maybe libmysqlclient does require it? Not sure...at any rate, I think something requires openssl - in particular, libssl 0.9.8 and libcrypto 0.9.8. That is what is happening in the compile stage - it is saying checking for mysql_ssl_set()... *** extconf.rb failed ***
, which indicates the pre-compilation step failed, not due to missing compilers, but rather due to a missing library (in this case, an ssl library). At least, that's how I'm interpreting that error.
Installing mysql2, json, RedCloth, and rdiscount succeed just fine.
I have the same issue with MariaDB on Debian 7. Very annoying and blocking ! Actually, I am using an embedded ruby version 2.2.0 which was compiled against openssl 1.0.0, but when trying to install mysql gem, it fails complaining about openssl! mysql2 installs just fine! No one on earth can give a workaround for this!
/opt/sensu/embedded/bin/ruby -r ./siteconf20160227-46298-b83bim.rb 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.
I think it has to do with openssl 1.0.0 being installed, where openssl 0.9.8 is required by the gem(?)...
I created a stackoverflow (http://stackoverflow.com/q/16205279/780281) and serverfault (http://serverfault.com/q/502575/153027) issue for it, and so far no luck...
As far as I can tell, all required dependencies (including dev packages) are installed.
Results when trying to install: