When I run this code
require 'rubygems'
require 'data_mapper'
require "sqlite3"
DataMapper::setup(:default, "sqlite3://#{Dir.pwd}./prod.db")
class Person
include DataMapper::Resource
property :id, Serial
def initialize(name)
self[:name] = name
self.save!
end
end
DataMapper.finalize.auto_migrate!
This error gets thrown
DataObjects::ConnectionError: unable to open database file (code: 14, sql state: , query: , uri: ).
It seems to be complaining about the DataMapper.finalize.auto_migrate!
line.
If I comment out the person class, the code runs fine, albeit, somewhat uselessly.
The OS I am getting the error on is Linux Mageia 2. I have run this fine on WindowsXP and Windows7 both running Ruby 1.9.3, though I suspect that the issue is the older ruby version is the issue not the OS.
Also, it is probably important for me to tell you that the permissions on the folder containing the file is very open (-rwxrwxrwx) (Its probably not practical for it to be this open for everyday use, but am desperate to get data_mapper working).
Here are other specs that may be interesting My local gems sqlite3 (1.3.7, 1.3.3) sqlite3-ruby (1.3.3) data_mapper (1.2.0)
I understand there are a lot of variables in here that could be changed. I thought I would put this out there first and see whether it was simple fix that I was dunderheadedly missing :)