Skip to content

Instantly share code, notes, and snippets.

@simeonwillbanks
Last active September 26, 2015 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simeonwillbanks/1158645 to your computer and use it in GitHub Desktop.
Save simeonwillbanks/1158645 to your computer and use it in GitHub Desktop.
#commandline #mysql2 #gem $ sudo gem install mysql2 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/bin/ruby extconf.rb --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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=/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/bin/ruby
--with-mysql-config
Gem files will remain installed in /Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/mysql2-0.3.7 for inspection.
Results logged to /Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/mysql2-0.3.7/ext/mysql2/gem_make.out
have_func: checking for rb_thread_blocking_region()... -------------------- no
"/usr/bin/gcc-4.2 -o conftest -I/opt/local/include -I. -I/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/1.8/i686-darwin11.0.1 -I. -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -g -O2 -pipe -fno-common conftest.c -L. -L/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib -L. -L'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib' -lruby-static -L/opt/local/lib -ldl -lobjc "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘rb_thread_blocking_region’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return 0; }
/* end */
"/usr/bin/gcc-4.2 -o conftest -I/opt/local/include -I. -I/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/1.8/i686-darwin11.0.1 -I. -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -g -O2 -pipe -fno-common conftest.c -L. -L/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib -L. -L'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib' -lruby-static -L/opt/local/lib -ldl -lobjc "
ld: warning: directory not found for option '-L/opt/local/lib'
Undefined symbols for architecture x86_64:
"_rb_thread_blocking_region", referenced from:
_t in ccsOmaOt.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { rb_thread_blocking_region(); return 0; }
/* end */
--------------------
have_header: checking for mysql.h... -------------------- no
"/usr/bin/gcc-4.2 -E -I/opt/local/include -I. -I/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/1.8/i686-darwin11.0.1 -I. -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -I/usr/local/Cellar/mysql/5.5.14/include -g -arch i386 -arch x86_64 -g -O2 -pipe -fno-common conftest.c -o conftest.i"
gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
checked program was:
/* begin */
1: #include <mysql.h>
/* end */
--------------------
have_header: checking for mysql/mysql.h... -------------------- no
"/usr/bin/gcc-4.2 -E -I/opt/local/include -I. -I/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/1.8/i686-darwin11.0.1 -I. -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I'/Users/simeon/.rbenv/versions/ree-1.8.7-2011.03/include' -I/usr/local/Cellar/mysql/5.5.14/include -g -arch i386 -arch x86_64 -g -O2 -pipe -fno-common conftest.c -o conftest.i"
gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
checked program was:
/* begin */
1: #include <mysql/mysql.h>
/* end */
--------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment