Skip to content

Commit

Permalink
Search more paths for MySQL installations in the 5.x series
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Feb 9, 2015
1 parent f054424 commit 0ee177c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/mysql2/extconf.rb
Expand Up @@ -20,13 +20,13 @@ def asplode lib
/opt
/opt/local
/opt/local/mysql
/opt/local/lib/mysql5
/opt/local/lib/mysql5*
/usr
/usr/mysql
/usr/local
/usr/local/mysql
/usr/local/mysql-*
/usr/local/lib/mysql5
/usr/local/lib/mysql5*
].map{|dir| "#{dir}/bin" }

GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}"
Expand Down

2 comments on commit 0ee177c

@ain
Copy link

@ain ain commented on 0ee177c Feb 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sodabrew unfortunately this doesn't seem to work, I just had it today and it failed to pick up from /opt/local/lib/mysql56 so I had to run gem install mysql2 -- --with-mysql-config=/opt/local/lib/mysql56/bin/mysql_config again in order to succeed :(

Is the glob actually working?

@sodabrew
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked for me... I'll double check again. The underlying behavior is correct in irb:

irb(main):006:0> Dir["{/foo,/opt/local/lib/mysql5*/bin}/{bar,mysql_config}"]
=> ["/opt/local/lib/mysql51/bin/mysql_config", "/opt/local/lib/mysql56/bin/mysql_config"]

Please sign in to comment.