Search code examples
mysqldatabaseruby-on-rails-3.1debian

How can I make Rails 3.1 work on Debian squeeze with MySQL Server 5.1?


I am trying to start a new application Ruby on Rails 3.1 on Debian Squeeze with MySQL Server 5.1 (the latest supported by Debian stable version).

I have problem with the mysql2 gem. When I use mysql2 gem version 0.2.6 rake migrations fail with error undefined method rows for nil class. I gooogled and everybody says that this error is resolved when one upgrades mysql2 gem to 0.3.X. However, when I do this upgrade I get another error about gem having been compiled for 5.5 mysql client and not 5.1.

Any help would much appreciated. Maybe the answer is "NO. YOU CANNOT DO IT". Even then, I want to know that.

Thanks in advance Panayotis


Solution

  • Well, this is a tricky question. My current rails package latest version is 2.3.5-1.2+squeeze2 and the current mysql-server package is 5.1.49-3, both from the stable debian repositories.

    However, you're trying to install RoR 3.1. That means you're not on stable or you are not trying to install it from any of the official debian repository at all (it is not wheeze nor sid).

    If you can install the stable version of rails, go ahead and I bet you won't have any trouble. Otherwise, if you want the most current release I'm pretty sure you'll have to go for the dirty way. It might probably involve download a 5.5 MySQL (not from the repositories, because it isn't there) and messing with the libraries.

    Remember if you require newer packages (such as newer libraries) and you don't want to use the testing repositories, you can always give debian backports a try.