今天在centos上面安装ruby 1.93跟rails 3.2的时候,出现个状况:
Could not find gem 'mysql2 (>= 0) ruby' in the gems available on this machine.
按照提示gem install mysql2
还是报错:
*** 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.
重新安装gem install mysql2 --with-mysql-dir=/usr/local/system/mysql
还是报错
没办法,进入ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11手动安装:
ruby extconf.rb --with-mysql-dir=/usr/local/system/mysql && make && make install
装完还是不行
最后google找到问题:
gem install mysql2 -- --with-mysql-dir=/usr/local/system/mysql
需要两个--