“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!

  • The motto for RubyGems should be "can't someone else do it?" 2010-10-25
  • New Superchunk makes me feel like I'm 17, anyone up for semi-ironically playing Mario Kart 64 and making Kraft Dinner? 2010-09-24
  • what an unfortunate (yet hilarious) name http://imgur.com/2biWk 2010-09-22
  • Hey Google, stop interrupting me when I'm trying to ask you a question! 2010-09-09
  • My new book will be called "Living in Synergy: Memoirs of an Unwed Power Couple" (with help from @EKinread of course) 2010-09-01
  • Can anyone recommend a good tailor in Hamilton? 2010-08-23
  • More updates...