ok, feel super dumb about asking a question that's apparently been asked multiple times. apologies in advance.
am following this tutorial: http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/
it requires mysql2 ...
tried to install it via "gem install mysql2"
this is what i get:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/name_withheld/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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
--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/name_withheld/.rvm/rubies/ruby-1.9.3-p194/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 /Users/name_withheld/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/name_withheld/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
so, poked around and saw this solution being proposed multiple times:
sudo apt-get install libmysql-ruby libmysqlclient-dev
unfortunately, i get: "command not found" ...
kind of at loss ...
wanted to do it via homebrew (since it seemed "simple") ... but there are several problems with that ...
- really unfamiliar with it ...
- not sure if i have it or not ...
so, tried brew update to see what i'd get ... this is what i got:
/usr/local/.git: Permission denied
Error: Failure while executing: git init
so ... tried to delete it via this code from here: https://gist.github.com/1173223
it doesn't seem to have done anything, and it kind of froze up, so quit it ...
not sure what to do now ... first priority is clearly trying to get mysql2 gem installed if possible ... homebrew is just side stuff ...
any other information needed here? any clarification need with my question? and sorry, didn't mean to make this question so long! just trying to cover as many bases as possible.
thanks in advance.
oh, my version of mac is 10.6.8 if that makes any difference ...
just tried one more thing: "brew install mysql" (via another stackoverflow question)
this is what i get:
Error: Cannot write to /usr/local/Cellar