Devlog :: And Wizardry

Mon, 02 Jan 2006

*OK. Now Rails really works (Try 3.1 did it)*

I spoke too soon last post. I did have Ruby and Rails installed and "working" all right, but Rails couldn't connect to mySQL. Since easy database integration is the main point of Rails I'd have to say that it wasn't really working after all. I did manage to get it to work after a lot of gymnastics though. First I realized the Ruby DBI modules weren't installed. I thought those went in with the standard install. Maybe not, or maybe it has something to do with the fact that mySQL was running from /usr/local/bin which belongs to root. The instance running in my space belonged to me but the "I don't own mySQL" theory turned out to be my best guess about the cause of my problems in the end. I tried to install the DBI/DBD but it didn't want to go. One of the things I tried is installing my own version of mySQL. I still couldn't get DBI to install. It kept quitting with a mysterious error about a file it installed having the wrong file type or format or something!?! I finally ran the installer in verbose mode and found out what it was trying to do. I then did everything by hand and it worked. Not right away of course. I also had to stop and start the server and kill my shell and log in again. Then I went away thinking it was still broken and came back and refreshed by browser for the n+1th time. And Bang! It was just working. I said Wow and my wife came in to see what was so great. It was a page where I could add a record to my database table. It replaced a page full of verbose error messages and debugging info. The add record worked too. It knew everything about my database table though all I gave it was the database name, the user, and password. I also gave it the table name through the "scaffold" tool. For that I got view/edit/add pages. Not bad. This morning I tried shutting down my version of mySQL and starting the /usr/local/bin one once again. It still didn't work. I'm not positive I couldn't get it to work but I'm not going to bother for now. The answer seems to be to use my own versions of everything in this virtual server environment. [/items/Rails] permanent link