MySQL Forums
Forum List  »  Ruby

Ruby APIs
Posted by: gjermund lunder
Date: June 10, 2010 09:28AM

Hi, Sorry if this is a wrong forum to post this. I'm new with MySql.

I've a simple question.
I have mysql version: 5.1.47-community
Ruby version 1.8.6-p398

Both on Windows XP. Our environment does not permit linux og cygwin (I'm used to work on these platfoms).

I've applied mysql gem with gem install mysql.

Do I need to add something more to ruby or mysql to do siple selects and insert to the database from ruby.

I've tried insert and get 0 (number zero) into the table, and ruby have problems with :

get '/' do
my ='localhost', 'root', 'sadmin', 'mysql')
st = my.prepare("SELECT VERSION()")
# Get the result set
result= st.fetch

# Print out the result
puts result.to_s

haml :index

can anyone help me? Please. With only Windows I have problems with solving this. As far as I know all API's are allready installed with the default installation of ruby and mysql as described above. Just my code that is bad :-)


Best regards
Gjermund (DBA - Oracle)

Options: ReplyQuote

Written By
Ruby APIs
June 10, 2010 09:28AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.