`dir_config': undefined method `split'

Having difficulty installing ‘gem install mysql2’. Getting these

gem install mysql2 –
–with-mysql-config=/opt/mysql/mysql/bin/mysql_config --with-opt-include
Building native extensions. This could take a while…
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb

–with-mysql-config=/opt/mysql/mysql/bin/mysql_config --with-opt-include
/usr/local/lib/ruby/1.9.1/mkmf.rb:1345:in dir_config': undefined methodsplit’ for true:TrueClass (NoMethodError)
from /usr/local/lib/ruby/1.9.1/mkmf.rb:1969:in init_mkmf' from /usr/local/lib/ruby/1.9.1/mkmf.rb:1994:in<top
(required)>’
from internal:lib/rubygems/custom_require:29:in require' from <internal:lib/rubygems/custom_require>:29:inrequire’
from extconf.rb:2:in `’

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6/ext/mysql2/gem_make.out

Does anybody know what i am missing?

Thanks.

On Mar 4, 1:41pm, Rick T. [email protected] wrote:

/usr/local/lib/ruby/1.9.1/mkmf.rb:1345:in `dir_config’: undefined method
Results logged to
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6/ext/mysql2/gem_make.out

Does anybody know what i am missing?

I think this is happening because you didn’t specify a path for --with-
opt-include. Arguably this is a bug in mkmf. Line 1345 is this:

idirs = idir ? Array === idir ? idir.dup :
idir.split(File::PATH_SEPARATOR) : []

idir is set by the with_config method, which can return a value, true
or false. The dir_config method will choke on true or false, though.

Anyway, try dropping the “–with-opt-include” option or specify the
path and see if that helps.

Regards,

Dan