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 = Mysql.new('localhost', 'root', 'sadmin', 'mysql')
st = my.prepare("SELECT VERSION()")
st.execute
# Get the result set
result= st.fetch

# Print out the result
puts result.to_s
st.close

haml :index
end

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 :-)

Thanks!

Best regards
Gjermund (DBA - Oracle)

Options: ReplyQuote


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


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

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.