Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Ruby DBI problem

    I'm trying to get MySQL to work with Ruby 1.8.

    I've d/l and installed the DBI (from RAA). I installed as follows:

    $>ruby setup.rb config --with=dbi,dbd_mysql,dbd_msql
    setup.rb:586: warning: parenthesize argument(s) for future version
    entering config phase...
    config done.

    $>ruby setup.rb setup
    setup.rb:586: warning: parenthesize argument(s) for future version
    entering setup phase...
    setting #! line to "#!/usr/local/bin/ruby"
    setup.rb: skip bin/proxyserver(dbd_proxy) by user option
    setup.rb: skip ext/dbd_sqlite(dbd_sqlite) by user option
    setup.rb: skip ext/dbd_sybase(dbd_sybase) by user option
    setup done.

    $>ruby setup.rb install
    entering install phase...
    mkdir -p /usr/local/bin
    install sqlsh.rb /usr/local/bin
    setup.rb: skip bin/proxyserver(dbd_proxy) by user option
    setup.rb: skip lib/dbd_ado(dbd_ado) by user option
    setup.rb: skip lib/dbd_db2(dbd_db2) by user option
    setup.rb: skip lib/dbd_interbase(dbd_interbase) by user option
    mkdir -p /usr/local/lib/ruby/site_ruby/1.8/DBD/Msql
    install Msql.rb /usr/local/lib/ruby/site_ruby/1.8/DBD/Msql
    mkdir -p /usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql
    install Mysql.rb /usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql
    setup.rb: skip lib/dbd_odbc(dbd_odbc) by user option
    setup.rb: skip lib/dbd_oracle(dbd_oracle) by user option
    setup.rb: skip lib/dbd_pg(dbd_pg) by user option
    setup.rb: skip lib/dbd_proxy(dbd_proxy) by user option
    setup.rb: skip lib/dbd_sqlrelay(dbd_sqlrelay) by user option
    mkdir -p /usr/local/lib/ruby/site_ruby/1.8/dbi
    install columninfo.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install dbi.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install row.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install sql.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install trace.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install utils.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    install version.rb /usr/local/lib/ruby/site_ruby/1.8/dbi
    mkdir -p /usr/local/lib/ruby/site_ruby/1.8/.
    install dbi.rb /usr/local/lib/ruby/site_ruby/1.8/.
    setup.rb: skip ext/dbd_sqlite(dbd_sqlite) by user option
    setup.rb: skip ext/dbd_sybase(dbd_sybase) by user option
    install done.


    However, when I type the following in at the command line: (with approriate
    username, pass, dbname, etc, and yes, the DB I try to use exists and this
    user has access)

    $> ruby -e 'require "dbi"; dbh = DBI.connect("DBI:MySQL:mydb", "username",
    "mypass")'

    I get the following error:

    /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:502:in `load_driver': Could not
    load driver (No such file to load -- mysql) (DBI::InterfaceError)
    from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:392:in
    `_get_full_driver'
    from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:372:in `connect'
    from -e:1

    So, instead of specifying the config --with option, I did default (all)

    $>ruby setup.rb config
    (same output as before)

    $>ruby setup.rb setup (** NOTE this output is different,and gives errors)
    entering setup phase...
    setting #! line to "#!/usr/local/bin/ruby"
    setting #! line to "#!/usr/local/bin/ruby"
    /usr/local/bin/ruby extconf.rb
    checking for sqlite_open() in -lsqlite... no
    make
    make: *** No targets specified and no makefile found. Stop.
    setup failed
    'system make' failed
    try "ruby setup.rb --help" for usage

    I go ahead and try to install anyway...

    $>ruby setup.rb install
    (same output as above, but instead of skips, it installs all. NOTE -- on
    errors here, even with the above errors in the setup.rb setup)

    Then, I go ahead and try my above "test", with the same errors.

    What am I doing wrong here?

    __________________________________________________ _______________
    Compare high-speed Internet plans, starting at $26.95.
    [url]https://broadband.msn.com[/url] (Prices may vary by service area.)



    Orion Hunter Guest

  2. Similar Questions and Discussions

    1. Problem with Ruby from CVS & ruby-ldap on Panther
      I've update my PB G4 to Penther recently and recompiled ruby from CVS. I've also recompiled ruby-ldap. When running a script of mine that extract...
    2. Big problem with debian ruby 1.8.0-1
      Hello, I have just upgraded ruby on my debian unstable to ruby 1.8.0-1 (2003-10-05), and my program has crashed. Here is the stripped down...
    3. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
      http://ruby-freedb.rubyforge.org/ http://ruby-serialport.rubyforge.org/ http://ruby-mp3info.rubyforge.org/ bye! --...
    4. Problem with ruby-dbi-all-0.0.20 and/or ruby-1.8.0
      The following test program works correctly with ruby-dbi-all-0.0.18 under ruby-1.6.8, but not ruby-dbi-all-0.0.20 under ruby-1.8.0: ...
    5. Ruby 1.8.0-9 Problem
      --0-1120296897-1058884260=:38363 Content-Type: text/plain; charset=us-ascii Shouldn't there be a warning or error message when try to concatenate...
  3. #2

    Default Re: Ruby DBI problem

    Doh! Thanks, that did the trick.

    And, for anyone else who looks this thread up for help, I also found that I
    had to d/l and install the libraries and headers for MySQL to get the
    aforementioned driver installed and working.

    >From: Michael Neumann <mneumann@ntecs.de>
    >To: Orion Hunter <orion2480@hotmail.com>
    >Subject: Re: Ruby DBI problem
    >Date: Tue, 18 Nov 2003 12:25:43 +0100
    >
    >On Tue, Nov 18, 2003 at 02:27:02PM +0900, Orion Hunter wrote:
    > > I'm trying to get MySQL to work with Ruby 1.8.
    > >
    > > I've d/l and installed the DBI (from RAA). I installed as follows:
    >
    >The Mysql DatabaseDriver from the DBI requires the following package:
    >
    > [url]http://www.tmtm.org/mysql/[/url]
    >
    >Install it, then it will work!
    >
    >Regards,
    >
    > Michael
    __________________________________________________ _______________
    Page a contact’s mobile phone with MSN Messenger. Get it FREE!
    [url]http://www.msnmessenger-download.com[/url]


    Orion Hunter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139