Code Monkey home page Code Monkey logo

mysql-gem's Introduction

MySQL/Ruby Interface

Maintainer needed

As January 1st, 2015, this project has become unmaintained:

https://groups.google.com/d/topic/rubyinstaller/nzpIDZqXO-Q/discussion

If you want to take over maintenance of this project, please open an issue stating your intention and we can coordinate the entire process there.

Thank you.

DESCRIPTION

This is the MySQL API module for Ruby. It provides the same functions for Ruby programs that the MySQL C API provides for C programs.

This package is offered as gem for easy installation using RubyGems. It wraps unmodified tmtm's mysql-ruby extension into a proper gem.

Please note that tmtm (Tomita Mashahiro) has deprecated development of this extension and only update it for bug fixes.

Warning about incompatible MySQL versions under Windows

Mixing MySQL versions will generate segmentation faults.

Running the binary version of this gem against a different version of MySQL shared library libMySQL.dll will generate segmentation faults and terminate your application.

Please use the exact same MAJOR.MINOR version of MySQL, see History.txt for specific version of MySQL used to build the binaries.

mysql-gem's People

Contributors

dui avatar ghazel avatar luislavena avatar mcandre avatar tenderlove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysql-gem's Issues

doesn't compile with 1.9

I think tmtm's 2.8.1 does...not sure though. This might not be much of an issue, but thought I'd mention it.
-=r

Trouble with mysql gem after updating to mysql 8 installation

I recently updated mysql through brew upgrade to the newest version:

$ mysql -V
mysql  Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)

Now my Ruby on Rails mysql connection stopped working.

For compatibility with the production environment I have to use gem 'mysql', '2.8.1' and everything was working perfectly before updating. After updating mysql I get the following error message:

$ rails s
=> Booting WEBrick
=> Rails 3.2.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
    SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
    This poses a security threat. It is strongly recommended that you
    provide a secret to prevent exploits that may be possible from crafted
    cookies. This will not be supported in future versions of Rack, and
    future versions will even invalidate your existing user cookies.

    Called from: /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/actionpack-3.2.5/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

Exiting
/Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/mysql_adapter.rb:32:in `mysql_connection': undefined method `init' for Mysql:Class (NoMethodError)
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:309:in `send'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:309:in `new_connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:319:in `checkout_new_connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:241:in `checkout'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in `loop'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in `checkout'
from /Users/MyAccount/.rvm/rubies/ruby-version/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:233:in `checkout'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:96:in `connection'
from /Users/MyAccount/.rvm/rubies/ruby-version/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activerecord-3.2.5/lib/active_record/railtie.rb:97:in `_callback_before_13'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:418:in `_run__1580337521__prepare__4__callbacks'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `send'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:405:in `__run_callback'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `send'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/actionpack-3.2.5/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/actionpack-3.2.5/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/application/finisher.rb:47
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/initializable.rb:55:in `run_initializers'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `each'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/application.rb:136:in `initialize!'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/railtie/configurable.rb:30:in `send'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/railties-3.2.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/MyAccount/Development/REPRO/webapp/config/environment.rb:9
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `gem_original_require'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/MyAccount/Development/REPRO/webapp/config.ru:3
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/rack-1.4.7/lib/rack/builder.rb:51:in `instance_eval'
from /Users/MyAccount/.rvm/gems/ruby-version@webapp/gems/rack-1.4.7/lib/rack/builder.rb:51:in `initialize'
from /Users/MyAccount/Development/REPRO/webapp/config.ru:0:in `new'
from /Users/MyAccount/Development/REPRO/webapp/config.ru:0

How can I solve this problem? Is there a way to solve the mysql connection?

Unfortunately mysql2 is not an option for the production environment.

Compilation on Snow Leopard

Hi,

the extension doesn't compile on Snow Leopard.
I fixed it by editing the autogenerated Makefile:

mf = File.read("Makefile")
open("Makefile", "w") do |f| 
  f << mf.gsub(/-ppc/, '').gsub(/-arch i386/, '') 
end 

But i couldn't find out how to make the rake-compiler to do the hook automatically.

mysql-gem faulty "fat binary" support: silent failure on *NIX

Issue

On non-Windows platforms, .../lib/mysql.rb silently discards any LoadError when loading mysql_api. *NIX platforms might give such an error if the system version of MySQL was incompatibly upgraded beyond that against which the mysql/ruby gem was built.

Symptoms

The ::Mysql module is created but more-or-less empty, with no methods and no meaningful constants. Example end-user symptoms are reported here and here.

Win 7 install error in Ruby 1.8.6

Forgive my ignorance. I have a script that has been handed down to me which queries a MySQL DB to change the name and IP address of a machine based off the mac. Of course that script uses Ruby and has worked with mysql 2.7.3 gem. I'm running Ruby 1.8.6 398 which I installed using the one-click installer on Windows 7. This is the first time I'm trying to get this script working on Win7. Any help would be appreciated.

When I "gem install mysql" I get:

"Successfully installed mysql-2.8.1-x86-mingw32
1 gem installed
Installing ri documentation for mysql-2.8.1-x86-mingw32...

No definition for next_result

No definition for field_name

No definition for field_table

No definition for field_def

No definition for field_type

No definition for field_length

No definition for field_max_length

No definition for field_flags

No definition for field_decimals

No definition for time_inspect

No definition for time_to_s

No definition for time_get_year

No definition for time_get_month

No definition for time_get_day

No definition for time_get_hour

No definition for time_get_minute

No definition for time_get_second

No definition for time_get_neg

No definition for time_get_second_part

No definition for time_set_year

No definition for time_set_month

No definition for time_set_day

No definition for time_set_hour

No definition for time_set_minute

No definition for time_set_second

No definition for time_set_neg

No definition for time_set_second_part

No definition for time_equal

No definition for error_errno

No definition for error_sqlstate
Installing RDoc documentation for mysql-2.8...

[lists the same no definition statements again]..."

Install fails on OS X with LLVM 5.1

Installing this via RubyGems fails on OS X after the update to Xcode 5.1 which comes with Apple LLVM 5.1. Here's the full console output:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mysql.c
linking shared-object mysql/mysql_api.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [mysql_api.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/mysql-2.9.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/mysql-2.9.1/gem_make.out

ERROR: Failed to build gem native extension.

Getting this error after running this command: gem install mysql.

mintty_2018-10-02_17-03-17

I am not facing issue with other gems and I have already searched StackOverflow but didn't found any solution.

Taking over maintenance

Hi @luislavena

As suggested in the README, I'm opening an issue for taking over maintenance of this gem. My employers (@unboxed) maintain a number of older Rails apps for people and we're currently trying to get a Rails 3.2 app running on Ruby 2.3.1. As part of that I'm working on cleaning up the Rails test suite on 3-2-stable and the errno warning is bugging me ๐Ÿ˜„

So what do I need to do next?

Mysql::Error: #08S01Bad handshake

Originally discovered at: http://bugs.ruby-lang.org/issues/5017

2.1.0 (May 31st, 2008) Activerecord
MySQL adapter
/home/username/rails_apps/appname/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb

No required 0 byte at end of string.

immediately after:
def real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=nil)
I inserted:
db = db + "\0" unless db == nil

for the purpose of appending the required 0 byte

Fixed it, for me, in an old and brittle app stuck with various further host restrictions.

Hoping to document issue and fix for the next poor sob.

Encoding problem

Hi, I have opened a bug on rubyforge about an encoding problem, but I don't know if it's not here that the bug should be reported. So, this is my bug:

conn = Mysql.init
conn.options(Mysql::READ_DEFAULT_GROUP, "client") # <- without this option, it works as I expect it
conn.options(Mysql::SET_CHARSET_NAME, "latin1")
conn.conn.character_set_name # => "latin1"
conn.real_connect(...)
conn.conn.character_set_name # => "utf8", but I expected "latin1"

Is MYSQL_OPT_PROTOCOL working/supported ?

EDIT: there was a mistake in my code, all is well, and you can ignore this issue.

Hi,

I want my connection to bypass the local unix socket all the time, but when I use localhost it seems to not be taken into account. Here the code I use for testing. When using the "-l" options the connection doesn't work:

./test.rb  -l
./test.rb:14:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)
        from ./test.rb:14:in `<main>'

given that my socket is in /run/mysql-default/mysqld.sock and that my default configuration file is /etc/mysql-default/my.cnf

My mysql.h on the platform (Ubuntu-Server 14.10) is

enum mysql_protocol_type 
{
  MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
  MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};

I see that in your test that it's commented.

So is that option supported or working at all when using localhost ?

Environment:

Ruby:

  /opt/chef/embedded/bin/ruby --version
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]

Mysql:

mysql --version
mysql  Ver 14.14 Distrib 5.6.19, for debian-linux-gnu (x86_64) using  EditLine wrapper

Mysql library:

libmysqlclient-dev                  5.5.40-0ubuntu1
ii  libmysqlclient18:amd64              5.5.40-0ubuntu1

Mysql Ruby library:

mysql (2.9.1)

on Ubuntu-Server 14.10.

Ubuntu 12.04 install error with ruby 2.0.0p0

I`ve cloned rails4.0.0beta1 from https://github.com/rails/rails.git.
I have ruby 2.0.0p0 (2013-02-24 revision 39474), when I am trying to do "bundle install" i have the following error message:

Installing mysql (2.9.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/zergood/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
checking for mysql_query()... -lmysqlclient
checking for main() in -lm... yes
checking for mysql_query()... -lmysqlclient
checking for main() in -lz... yes
checking for mysql_query()... -lmysqlclient
checking for main() in -lsocket... no
checking for mysql_query()... -lmysqlclient
checking for main() in -lnsl... yes
checking for mysql_query()... -lmysqlclient
checking for main() in -lmygcc... no
checking for mysql_query()... -lmysqlclient
*** 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=/home/zergood/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /home/zergood/.rvm/gems/ruby-2.0.0-p0/gems/mysql-2.9.1 for inspection.
Results logged to /home/zergood/.rvm/gems/ruby-2.0.0-p0/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

An error occurred while installing mysql (2.9.1), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.9.1'` succeeds before bundling.

Having issues building mysql gem in ruby 2.0.0 in Windows

I've documented the issue in this SO question http://stackoverflow.com/questions/17673612/installing-mysql-ruby-gem-in-windows-fails-using-ruby-2-0-0

However here's a quick overview - I'm running the following command from the tutorial http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32

I get the following error

This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

C:/ruby200/bin/ruby.exe extconf.rb --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32 --with-mysql-lib=C:\mysql-connector-c-noinstall-6.0.2-win32\lib\libmysql.dll
checking for main() in -llibmysql... no
*** extconf.rb failed ***

I'm not quite sure what i'm doing wrong here.

Warning: instance variable errno not initialized

Hello folks,

this warning happens while running the activerecord mysql test suite. Please look at the following link:
https://travis-ci.org/rails/rails/jobs/16809416#L117

At this point the warning happens:

ARCONN=mysql /home/vagrant/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -w -I"lib:test" -I"/home/vagrant/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib" "/home/vagrant/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/rake_test_loader.rb"  "test/cases/disconnected_test.rb" -v

Would it be a better to explicitly set an ivar even when the assigned value would be nil?

https://github.com/luislavena/mysql-gem/blob/master/ext/mysql_api/mysql.c#L1873
I think that would be a good place to start initialization?

What do you think?

Cheers

It's not clear that this is the canonical source of the mysql gem

I spent around an hour trying to work out the location of the source of the mysql gem[1]. The homepage is listed as the mysql-win gem[2], and although that lists the mysql 2.8.1 gem in the files list[3], the name/metadata is misleading and the code in the subversion repo[4] is out of date. The README[5] also states that this is a rubygems version of tmtm's[6] original mysql-ruby[7] project which only serves to add confusion.

Only by searching for 'luislavena github mysql'[8] did I find this project. I don't think this project makes it clear that it's the canonical source of the mysql gem either.

I'd like to suggest the following steps to clarify the situation for other people looking for this project.

  • Changing the homepage on rubygems.org to point to this github project.
  • Additionally/alternatively adding a 'Source Code' link on rubygems.org that points to this github project.
  • Update the description of the mysql-win rubyforge project to make it clear that this is the home of the mysql gem (i.e. it's not just the windows version) and point people to this github project for the source.
  • Potentially remove the mysql-win subversion repo or keep it in sync with this github repo.
  • Update the README in this github project to give an overview of the history of the mysql gem (for example, I'm still not clear exactly what relation this version has with tmtm's original as that now appears to be at 2.8.2).

I hope you don't mind me making these suggestions and I'm more than willing to help out with any modifications of this github project. Let me know if there's anything I can do.

[1] http://rubygems.org/gems/mysql
[2] http://rubyforge.org/projects/mysql-win/
[3] http://rubyforge.org/frs/?group_id=1598
[4] http://rubyforge.org/scm/?group_id=1598
[5] http://rubyforge.org/frs/shownotes.php?release_id=38245
[6] http://tmtm.org/
[7] http://rubyforge.org/projects/mysql-ruby/
[8] http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=luislavena+github+mysql

require error on Windows with Ruby 2.0.0p0

C:\>ruby -v
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

C:\>gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.3.4)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
mysql (2.9.1 x86-mingw32)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
rubygems-update (2.0.3)
test-unit (2.0.0.0)

C:\>irb
DL is deprecated, please use Fiddle
irb(main):001:0> require 'mysql'
LoadError: cannot load such file -- mysql/mysql_api
        from C:/RubyAuto/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
        from C:/RubyAuto/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
        from C:/RubyAuto/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mysql.rb:6:in `rescue in <top (required)>'
        from C:/RubyAuto/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mysql.rb:2:in `<top (required)>'
        from C:/RubyAuto/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
        from C:/RubyAuto/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
        from C:/RubyAuto/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
        from (irb):1
        from C:/RubyAuto/bin/irb:12:in `<main>'

doesn't compile on debian testing 64bit with ruby 1.9.x

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:

gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

        /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/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
    --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=/home/jarrett/.rvm/rubies/ruby-1.9.1-p431/bin/ruby
    --with-mysql-config
    --without-mysql-config
/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.
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:417:in `try_link0'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:421:in `try_link'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:529:in `try_func'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:774:in `block in have_func'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:250:in `open'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:250:in `open'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:272:in `postpone'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for'
    from /home/jarrett/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/mkmf.rb:773:in `have_func'
    from extconf.rb:45:in `<main>'


Gem files will remain installed in /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1 for inspection.
Results logged to /home/jarrett/.rvm/gems/ruby-1.9.1-p431/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

License

Under which license is this project? MIT? Apache-2.0? I need the info for VersionEye.

Build failing in Mac OS X

When I try to build mysql-gem in Mac, I get Could not create Makefile due to some reason.

Trace:

$ gem install mysql -v '2.9.1'
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

    /usr/local/Cellar/ruby/1.9.3-p385/bin/ruby extconf.rb
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... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
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.

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/Cellar/ruby/1.9.3-p385/bin/ruby
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p385/lib/ruby/gems/1.9.1/gems/mysql-2.9.1 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p385/lib/ruby/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

System:

$ specs ruby os
Specs:

specs 0.4
https://github.com/mcandre/specs#readme

bundle --version
Bundler version 1.3.5

gem --version
2.0.3

ruby --version
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.0]

system_profiler SPSoftwareDataType | grep 'System Version'
      System Version: OS X 10.8.3 (12D78)

[OT] - Thank you

It was hard for me to pick one project to say thank you ^_^.

You are one of the invisible ones, the ones that give tremendous tools to the community and sadly deal with the jokes and consequences.

I just want to take time to say thank you for your hard work and for the countless hours you spent helping other. A bunch of us are aware that your time and passion is priceless so thank you for sharing it.

Not able to install mysql gem in ruby 2.3.3

Not able to install mysql gem in ruby 2.3.3. My ruby version : ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]. Getting belo exception while installing mysql gem.
C:\Ruby23-x64>gem install mysql
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mysql-2.9.1/ext/mysql_api

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170123-7004-xoua5t.rb extconf.rb
checking for main() in -llibmysql... 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.

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=C:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-libmysqllib
--without-libmysqllib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/mysql-2.9.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mysql-2.9.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/mysql-2.9.1/gem_make.out
Attaching gem_make.out and mkmf.log files.
gem_makeout.txt
mkmflog.txt
My ruby Dev kit version : DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
Would please help me to resolve the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.