Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Unable to Connect to Mysql from ruby

Question posted by: idealfellow (Newbie) on January 25th, 2008 08:53 AM
Hi Guys,
I have tried out several ways to connect to my MYSQL database thru Ruby on my windows machine.
I have used ruby-mysql, mysql-ruby, ruby DBI....but havent been lucky so far,
is there any installer kind of a thing to do this stuff!
""I get the following error - mswin32-ruby16.dll was not found""

Can anybody guide me in steps getting this working for me!!!
Let me know if you require any more information.


Thanks in Advance
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
improvcornartist's Avatar
improvcornartist
Expert
153 Posts
January 25th, 2008
04:48 PM
#2

Re: Unable to Connect to Mysql from ruby
Are you using Rails, or only Ruby? Do you know if you have an ODBC installed for MySQL?

Reply
idealfellow's Avatar
idealfellow
Newbie
13 Posts
January 28th, 2008
07:34 AM
#3

Re: Unable to Connect to Mysql from ruby
I am using just Ruby.
I have installed Mysql ODBC 3.51 Driver ,I can see that - Data Source(ODBC) under Administrative Tools in windows.

let me know if i need to test anything specifically for that.

Cheers

Reply
vinram's Avatar
vinram
Newbie
3 Posts
January 28th, 2008
11:10 AM
#4

Re: Unable to Connect to Mysql from ruby
Quote:
Originally Posted by idealfellow
Hi Guys,
I have tried out several ways to connect to my MYSQL database thru Ruby on my windows machine.
I have used ruby-mysql, mysql-ruby, ruby DBI....but havent been lucky so far,
is there any installer kind of a thing to do this stuff!
""I get the following error - mswin32-ruby16.dll was not found""

Can anybody guide me in steps getting this working for me!!!
Let me know if you require any more information.


Thanks in Advance



hi,

just check after u install ruby and rails ...go to browser and type http://localhost:3000/ u will get a page with the below details appear when u click a link "about your application's environment" :

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 0.9.4
Rails version 1.2.5
Active Record version 1.15.5
Action Pack version 1.13.5
Action Web Service version 1.2.5
Action Mailer version 1.3.5
Active Support version 1.4.4
Application root C:/rails/sample
Environment development
Database adapter mysql

Reply
improvcornartist's Avatar
improvcornartist
Expert
153 Posts
January 28th, 2008
02:00 PM
#5

Re: Unable to Connect to Mysql from ruby
You should be able to connect using something like the following.
Code: ( text )
  1. require 'DBI'
  2. DBI.connect('DBI:ODBC:DSN', 'username', 'password')
  3. #Where DSN is your actual data source name.

This DBI page might have some helpful info.

Reply
idealfellow's Avatar
idealfellow
Newbie
13 Posts
January 29th, 2008
09:49 AM
#6

Re: Unable to Connect to Mysql from ruby
Quote:
Originally Posted by vinram
hi,

just check after u install ruby and rails ...go to browser and type http://localhost:3000/ u will get a page with the below details appear when u click a link "about your application's environment" :

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 0.9.4
Rails version 1.2.5
Active Record version 1.15.5
Action Pack version 1.13.5
Action Web Service version 1.2.5
Action Mailer version 1.3.5
Active Support version 1.4.4
Application root C:/rails/sample
Environment development
Database adapter mysql


HI Vinram,
I am not using Ruby on Rails!!!

Reply
chandrabhanu's Avatar
chandrabhanu
Newbie
2 Posts
March 5th, 2008
05:36 AM
#7

Re: Unable to Connect to Mysql from ruby
Hi i am working frist time on ruby.

Anyone tell me how can we write query our page for inserting ,fetchimg record from database.i am using dtabase mysql.

and i have installed Instantrails on windows xp.

Reply
Reply
Not the answer you were looking for? Post your question . . .
174,849 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Ruby / Rails Forum Contributors