“Unable to Open Database” with Sqlite3

This entry was posted February 19 2009 under *nix, Errors.

3 comments

Just spent an hour or so trying to figure out why my Sinatra app running DataMapper couldn’t write to my sqlite database, and kept returning the vague error “Unable to Open Database”.  Turns out the problem is as simple as making sure that the user running the script not only has write permissions on the database file, but also on the directory that the datbase file is in.  If you find yourself getting this error and you can’t figure out why, that’s probably the problem!

Comments

This blog post really came in handy just now.
Small internet, eh?
I have similar problem, but only if I do order_by in ActiveRecord. This works : @posts = Post.find :all This throws an error: @posts = Post.find :all, :order => 'created_at desc'

Post a Comment







OMG Who?

I'm Sean Roberts, a 24-year-old Ruby on Rails developer currently working for Hamilton web design firm factor[e] design initiative. This is my blog about work and nerd stuff, and maybe a little bit about music and food too.

I'm On Twitter!

  • Can anyone recommend a good tailor in Hamilton? 2 weeks ago
  • Alphabits are a highly underrated cereal. Just saying. 2 weeks ago
  • Oh look, another good deal on a product that I need and can't find at a store around here. Do they ship to Canada? Of course not. 3 weeks ago
  • RT @JayHiggins: I'm going to be positive: Games big success, Ticats sold to billionare, LRT, Condo Dev at WH, Bettman retires 3 weeks ago
  • Wait, Hamilton has a football team? 3 weeks ago
  • Hooray for west harbour! I promise to not be sarcastic RE: government for a couple days. Probably. 3 weeks ago
  • More updates...