Welcome Guest | Login

ruby/mysql API

I have a ruby script that needs to access a mysql database.  I would like to use the ruby/mysql API to do this.  I believe that ruby/mysql underlies Rails database access.  But when I run the script, the script fails to load
require 'mysql'
 Is there something I need to install or configure?

Also, according to the HostingRails home page, MySQL 5.x is supported.  What do I have to do to upgrade from my current 4.1.22 (as shown in phpMyAdmin)?  I guess ruby/mysql is not supposed to work with 4.1.x .

2007-06-01 02:24 PM

Hello,

Did you try using :
require 'rubygems'
require_gem 'mysql'
Are you getting any errors ?

2007-06-01 03:24 PM

HostingRails Support
With that change I get:

/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:301:in `report_activate_error': Could not find RubyGem mysql (>= 0.0.0) (Gem::LoadError)

2007-06-01 03:40 PM

Hello,

I am sorry, I have installed the mysql gem on the server. Could you please try now.

2007-06-01 04:07 PM

HostingRails Support
With the following code:
require 'rubygems'
gem 'mysql'
I still get the Gem::LoadError reported previously

2007-06-01 04:18 PM

Could you try again. Its working for me.

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'mysql'
=> true
irb(main):003:0>  

2007-06-01 05:36 PM

HostingRails Support
That's better.  Thanks.

2007-06-02 02:17 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.