# permissions for an sqlite3 db?  rake aborted

**URL:** <https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980>\
**Category:** rubyonrails-talk\
**Created:** [November 29, 2007, 8:36am UTC](https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980 "2007-11-29T08:36:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Thufir](https://discuss.rubyonrails.org/u/Thufir)\
**Post date:** [November 29, 2007, 8:36am UTC](https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980/1 "2007-11-29T08:36:13Z")

</div>

It's not clear to me why the rake fails. Would it be helpful to post the trace? seemed spammy. I assume it's some sort of permissions issue, although a google search turned up other ideas (which seemed unlikely so I won't repeat them).

Any and all thoughts please!

thufir@arrakis ~/rubyCode/straw $ thufir@arrakis ~/rubyCode/straw $ ll db/ total 4 drwxr-xr-x 2 thufir users 4096 Nov 29 00:31 migrate -rw-rw-rw- 1 thufir users 0 Nov 29 00:31 straw.db thufir@arrakis ~/rubyCode/straw $ thufir@arrakis ~/rubyCode/straw $ sqlite3 db/straw.db SQLite version 3.4.1 Enter ".help" for instructions

> .schema .quit

thufir@arrakis ~/rubyCode/straw $ cat config/database.yml

development: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adapter: sqlite3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dbfile: /home/thufir/straw/db/straw.db test: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adapter: sqlite3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dbfile: /home/thufir/straw/db/straw.db production: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adapter: sqlite3 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dbfile: /home/thufir/straw/db/straw.db thufir@arrakis ~/rubyCode/straw $ thufir@arrakis ~/rubyCode/straw $ cat db/migrate/001\_feeds.rb

class Feeds \< ActiveRecord::Migration &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def self.up &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;create\_table :feeds do |table| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table.column :title, :string &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table.column :location, :string &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table.column :category\_id, :integer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def self.down &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drop\_table :feeds &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end end thufir@arrakis ~/rubyCode/straw $ thufir@arrakis ~/rubyCode/straw $ rake db:migrate (in /home/thufir/rubyCode/straw) rake aborted! could not open database

(See full trace by running task with --trace) thufir@arrakis ~/rubyCode/straw $

thanks,

Thufir

---

<div class="post-metadata">

**Author:** ![Greg\_Donald1](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/greg_donald1/32/1313_2.png) [@Greg\_Donald1](https://discuss.rubyonrails.org/u/Greg_Donald1)\
**Post date:** [November 29, 2007, 4:15pm UTC](https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980/2 "2007-11-29T16:15:48Z")

</div>

I had this problem once a while ago. My Ruby had sqlite version 2 support instead of version 3 or something like that. My point is it was giving me what looked like permission errors but it was really a sqlite version conflict. Hope that helps.

---

<div class="post-metadata">

**Author:** ![Thufir](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Thufir](https://discuss.rubyonrails.org/u/Thufir)\
**Post date:** [November 30, 2007, 5:16am UTC](https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980/3 "2007-11-30T05:16:41Z")

</div>

I have no idea what the problem was, but the solution was to not create the db myself but to have the migration do it (and the rails command create the database.yml automagically!):

thufir@arrakis ~/rubyCode $ thufir@arrakis ~/rubyCode $ cat sqLiteStraw.rb require 'fileutils' require 'sqlite3'

FileUtils.rmtree 'straw' system("rails straw --database=sqlite3") FileUtils.cd('straw', :verbose =\> true)

---

<div class="post-metadata">

**Author:** ![Thufir](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Thufir](https://discuss.rubyonrails.org/u/Thufir)\
**Post date:** [November 30, 2007, 5:16am UTC](https://discuss.rubyonrails.org/t/permissions-for-an-sqlite3-db-rake-aborted/20980/4 "2007-11-30T05:16:41Z")

</div>

I have no idea what the problem was, but the solution was to not create the db myself but to have the migration do it (and the rails command create the database.yml automagically!):

thufir@arrakis ~/rubyCode $ thufir@arrakis ~/rubyCode $ cat sqLiteStraw.rb require 'fileutils' require 'sqlite3'

FileUtils.rmtree 'straw' system("rails straw --database=sqlite3") FileUtils.cd('straw', :verbose =\> true)
