好吧,对于问一个显然被问过多次的问题感到超级愚蠢。提前道歉。
我正在关注本教程:http ://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/
它需要mysql2 ...
尝试通过“gem install mysql2”安装它
这就是我得到的:
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
所以,四处逛逛,看到这个解决方案被多次提出:
sudo apt-get install libmysql-ruby libmysqlclient-dev
不幸的是,我得到:“找不到命令”......
有点不知所措……
想通过自制软件来做(因为它看起来“简单”)......但是有几个问题......
- 实在是太陌生了……
- 不知道我有没有...
所以,尝试 brew update 看看我会得到什么......这就是我得到的:
/usr/local/.git: Permission denied
Error: Failure while executing: git init
所以...试图从这里通过此代码删除它:https ://gist.github.com/1173223
它似乎没有做任何事情,而且它有点冻结,所以退出它......
不知道现在该做什么...首要任务显然是尽可能安装mysql2 gem ...自制软件只是附带的东西...
这里需要任何其他信息吗?我的问题需要任何澄清吗?抱歉,我不是故意让这个问题这么久!只是试图覆盖尽可能多的基地。
提前致谢。
哦,我的mac版本是10.6.8,如果这有什么不同的话......
刚刚尝试了另一件事:“brew install mysql”(通过另一个stackoverflow问题)
这就是我得到的:
Error: Cannot write to /usr/local/Cellar