`dir_config': undefined method `split'

R

Rick Tan

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 method
`split' 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:in `require'
from extconf.rb:2:in `<main>'


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.
 
D

Daniel Berger

Having difficulty installing 'gem install mysql2'. =A0Getting these

gem install mysql2 --
--with-mysql-config=3D/opt/mysql/mysql/bin/mysql_config --with-opt-includ= e
Building native extensions. =A0This could take a while...
ERROR: =A0Error installing mysql2:
=A0 =A0 =A0 =A0 ERROR: Failed to build gem native extension.

=A0 =A0 =A0 =A0 /usr/local/bin/ruby extconf.rb
--with-mysql-config=3D/opt/mysql/mysql/bin/mysql_config --with-opt-includ= e
/usr/local/lib/ruby/1.9.1/mkmf.rb:1345:in `dir_config': undefined method
`split' for true:TrueClass (NoMethodError)
=A0 =A0 =A0 =A0 from /usr/local/lib/ruby/1.9.1/mkmf.rb:1969:in `init_mkmf= '
=A0 =A0 =A0 =A0 from /usr/local/lib/ruby/1.9.1/mkmf.rb:1994:in `<top
(required)>'
=A0 =A0 =A0 =A0 from <internal:lib/rubygems/custom_require>:29:in `requir= e'
=A0 =A0 =A0 =A0 from <internal:lib/rubygems/custom_require>:29:in `requir= e'
=A0 =A0 =A0 =A0 from extconf.rb:2:in `<main>'

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?

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 =3D idir ? Array =3D=3D=3D 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top