Hello fellow RoR users,
I am a newbie and I thought RoR is so easy to set up and that I would
be saving so much time – but I am still waiting to save time because I
simply couldn’t get Ruby/Rails to talk to MySQL (5.0.18) at all.
Here are the steps that I have examined:
I look at dabatbase.yml and put in the right information to talk to
the database I have set up (the information is correct because I have
used MySQL-front and MySQL administrator to talk to it). I ensure there
was no weird characters in the file.
In the out-of-box database.yml, it says “On Windows: There is no gem
for Windows. Install mysql.so from RubyForApache.” A supposedly popular
framework that doesn’t support the popular Windows+MySQL setup – fine,
even though the often touted “convention over configuration” ease-of-use
fails to apply here, I am technical enough, so I go deep. I got the
Because I have ruby installed with cygwin, the default place is
C:\cygwin\lib\ruby (There was a bug in RubyForApache that even if you
choose the right folder for your ruby installation, it still appends
extra paths as if it still assume the default Ruby installation
directory is C:\ruby – fine, I can live with the often touted
user-friendliness here). So I set it up to have mysql.so copied to
So now, what do we do? Because I assume the often-touted the RoR
community writes documentation better and appreciate good documentation
than the other frameworks, I assume I don’t have to do anything more.
- So I try: ruby script/generate and the following error (a snippet
without the rest of the trace) comes up:
ecord::AdapterNotSpecified: adapter:mysql database:test username:root
password:admin host:localhost database is not configured
OK, so I search on combinations of keywords here. Nothing turns up.
OK, so I am on my own. Many posts related to “MySQL, Windows” sugguests
that one “gem install mysql” because it would be faster anyway. But
that requires one to download the right MySQL headers and library and
compile the whole thing yourself. Without knowing whether it would
really solve the problem, I paused and search for more answers on-line.
(Actually, I lied: I did try to download the source from MySQL
nightly-build for Windows: the thing is, the downloaded tree, for one
thing, has only “include” but no the so-claimed-necessary “lib” – that
was a bad sign, and even now with different options for gem install
mysql --with-…," nothing helped. Since I haven’t compiled MySQL
myself on Windows or at all, I am no expert, so I am going no further.)
I’ve found no answers and I found you here… If you would know how
I can troublshoot what’s happening here, I would greatly appreciate it.
Otherwise, I really don’t know how a supposedly developer-friendly
framework can be taking 10x time to set up and deploy (that would negate
any so-claimed “10x” saving in the actual coding process, wouldn’t it?
Because if one can’t even set it up to test and evalute RoR easily, how
is it that one would feel so comfortable and confident in its
scalability and robustness?)
Go Ruby/RoR. I hope there is an easy answer for this popular
Windows+MySQL+CygWin environment. I am holding my faith for “convention
over configuration” delicately right now.