Posted by Amit Rathore on November 14, 2006
I tried getting rails up and running on my (fairly) new iMac a few days back, and although I installed mysql gem currectly, the code was unable to connect to the mysql server. In fact, it threw an error -
mysql.c:2015: error: ulong undeclared
It befuddled me for a bit, because when the mysql gem is installed (gem list shows it), it compiles the native extensions - and that had succeeded. Or so I thought. Long story short - there appears to be a problem when trying to compile this gem on Intel Macs - and here’s the fix.
1. Go to gems directory - it will be somewhere under your ruby directory. Edit mysql.c, and add “#define ulong unsigned long” to it.
2. Then do ruby extconf.rb install mysql — –with-mysql-dir=yourmysqldirectory/
3. make
4. make install
This fixed things, and now, mysql can be used satisfactorily.
Posted in code, database, rails, ruby | No Comments »
Posted by Amit Rathore on August 17, 2006
That was nightmarish!
All I wanted was SQLite working with Rails. That’s all. And it was quick and easy - on my Ubuntu workstation at home, that is. And then, began 2 hours of gruesome agony - as I tried desperately to get the damn thing to work on my RHEL staging box.
I only have shell access to this machine - so no fancy graphical package manager. If I had a package manager, I would have selected libsqlite0-dev (the missing item) as well as libsqlite3-dev just to be safe, and would have saved myself the afore-mentioned two hour hair-pulling.
Here are the steps to get SQLite working with Rails -
* Download sqlite from http://www.sqlite.org/download.html. Compile and install the usual way. Or just get the compiled versions.
* Install libsqlite-dev (both libsqlite-dev3 AND libsqlite-dev0-> AAARGH!)
* Download, compile and install swig -> http://www.swig.org/download.html
* Install the sqlite3-ruby gem
* Downlad ruby-dbi and follow instructions on http://ruby-dbi.rubyforge.org/
Everything should work now! I tested this with Typo 4.0.3 and it works. Phew!
Posted in code, database, rails, ruby | No Comments »