views:

25

answers:

1

Hi. I need to query my database using mysql native functions such as YEAR(date) or NOW().... This works on staging and on production environments but it won't work in my development environment because of SQLite's lack of support to these functions.

Can you help?

Thank you.

+1  A: 

you could check for development RAILS_ENV and use native sqlite functions in this cases (datetime('now') instead of now() etc.) but this would just bloat your code - certainly its easier / cleaner to just use a local mysql instance for development ...

roman
Installing MySQL is the way to go for sure. It's not hard and it means your development environment actually reflects what you're deploying.
tadman
I absolutely agree. Installing MySQL's pretty easy...heck, even better would be to actually develop on a machine identical to your prod machines. Here we use Ubuntu on VMWare to develop, just so we don't have to worry about deployment issues like the one you're describing. Hope this helps!
btelles