Topic: Windows 7, RoR, and Mysql???
I'm a .net dev who wants to try out ruby on rails, but after 4 hours of trying to get it to work on Windows 7 with MySQL, I'm about to pull my hair out.
The default "Welcom aboard" page comes up, but the picture doesn't and in the console I get:
"Mysql2::Error (Can't connect to MySQL server on 'localhost' (10061)):"
I've seen about a thousand guides/tutorials/posts/etc.. on why this happens and how to fix it, but nothing has worked.
Here is the process I've come up with:
- Install Ruby
- http://rubyinstaller.org/downloads/
- Make sure gem is up to date
- gem update --system
- Install Rails
- gem install rails
- Install MySQL
- http://www.mysql.com/downloads/mysql/
- Install mysql gem
- gem install mysql2
- Install Ruby on windows dev kit
- https://github.com/oneclick/rubyinstall … opment-Kit
- Generate devkit config file
- C:\RubyDevKit> ruby dk.rb init
- Run dev kit install
- C:\RubyDevKit> ruby dk.rb install
- Test Installation
Confirm your Ruby environment is correctly using the DevKit by running gem install rdiscount --platform=ruby. RDiscount should install correctly and you should see Temporarily enhancing PATH to include DevKit... in the screen messages. Next run ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html" to confirm that the rdiscount gem is working.
- Fix MySQL connector DLL
- http://www.mysql.com/downloads/connector/c/
- download mysql-connector-c-noinstall-6.0.2 zip (32 bit version)
- copy libmysql.dll from lib directory inside zip and paste it into ruby bin install location "C:\Ruby193\bin"
- compile mysql2 with my version of mysql connector
- gem install mysql2 --platform=ruby -- --with-mysql-dir=C:/RailsInstaller/mysql
Versions I'm using:
Win 7 64bit
Ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Rails 3.2.6
MySql Ver 14.14 Distrib 5.5.25, for Win64 (x86)
mysql-connector-c-noinstall-6.0.2-win32
mysql2 (0.3.11 ruby x86-mingw32)
database.yml:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: simple_cms_development
pool: 5
username: root
password:
host: localhost
I can pull up a mysql prompt, login and see the databases. So, I think MySql is working, there is just some connection issue where Rails can't talk to it. Any ideas would be greatly appreciated.
Thanks
Last edited by TimB (2012-06-29 16:04:06)