Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Connecting mySQL to Ruby on NETBEAN 8.0

  1. Sep 19, 2014 #1
    So... I hae this issue trying to connect mySQL to ruby on net bean... Has anyone connected it before?

    The code:

    #!/user/bin/ruby


    require 'mysql'


    begin
    puts "hello World"
    con = Mysql.new 'localhost', 'sqluser', ''
    puts con.get_server_info
    rs = con.query 'SELECT VERSION();'
    puts rs.fetch_row

    rescue Mysql::Error => e
    puts e.errno
    puts e.error

    ensure
    con.close if con
    end

    LoadError: no such file to load -- mysql
    require at org/jruby/RubyKernel.java:1027
    require at /Users/eugenelemon/Library/Application Support/NetBeans/8.0/jruby/lib/ruby/shared/rubygems/custom_require.rb:36
    (root) at /Users/eugenelemon/NetBeansProjects/RubyApplication1/lib/main.rb:9
     
  2. jcsd
  3. Sep 22, 2014 #2

    Borg

    User Avatar
    Gold Member

  4. Sep 22, 2014 #3

    Borek

    User Avatar

    Staff: Mentor

    Looks like the problem occurs long before you try to connect to the database.
     
  5. Oct 17, 2014 #4
    Looks like it's a MySQL server issue as it's not able to access the database file that you're trying to pull.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Connecting mySQL to Ruby on NETBEAN 8.0
  1. New to NetBeans (Replies: 2)

  2. Learning Ruby (Replies: 0)

  3. Help with MySQL (Replies: 3)

Loading...