`dir_config': undefined method `split'

Discussion in 'Ruby' started by Rick Tan, Mar 4, 2011.

  1. Rick Tan

    Rick Tan Guest

    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.

    --
    Posted via http://www.ruby-forum.com/.
     
    Rick Tan, Mar 4, 2011
    #1
    1. Advertising

  2. On Mar 4, 1:41=A0pm, Rick Tan <> wrote:
    > 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
     
    Daniel Berger, Mar 4, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    482
  2. Carlos Ribeiro
    Replies:
    11
    Views:
    721
    Alex Martelli
    Sep 17, 2004
  3. trans.  (T. Onoma)

    split on '' (and another for split -1)

    trans. (T. Onoma), Dec 27, 2004, in forum: Ruby
    Replies:
    10
    Views:
    230
    Florian Gross
    Dec 28, 2004
  4. Ralph Kon
    Replies:
    1
    Views:
    115
  5. Deche Pangestu
    Replies:
    2
    Views:
    231
    Luis Lavena
    Nov 9, 2010
Loading...

Share This Page