Permission denied errors with rake db:migrate


#1

I am at a loss here and hoping for some advise on where to begin looking
with a series of errors I am suddenly getting when trying to rake:
“anything goes here” …

lil-loco:/rails/cem craigmartin$ rake db:migrate
(in /rails/cem)
rake aborted!
Permission denied - /rails/cem/db/schema.rb

This is the current error.

lil-loco:/rails/cem craigmartin$ rake db:schema:load
(in /rails/cem)
– create_table(“pages”, {:force=>true})
-> 0.1730s
– initialize_schema_migrations_table()
-> 0.0008s
– assume_migrated_upto_version(20090205221128)
-> 0.0007s

This command ran successfully.

When I add a --trace nothing too enlightening shows up but I can add the
trace if someone wants to see it.

Thanks in advance for anyone who can help me out here.


#2

On Wed, Apr 1, 2009 at 4:33 PM, Craig M.
removed_email_address@domain.invalid wrote:

I am at a loss here and hoping for some advise on where to begin looking
with a series of errors I am suddenly getting when trying to rake:
“anything goes here” …

lil-loco:/rails/cem craigmartin$ rake db:migrate
(in /rails/cem)
rake aborted!
Permission denied - /rails/cem/db/schema.rb

Does /rails/cem/db exist? Is it writable by your user?

Can you do something like:

touch /rails/cem/db/schema.rb ?


Greg D.
http://destiney.com/


#3

Greg D. wrote:

On Wed, Apr 1, 2009 at 4:33 PM, Craig M.
removed_email_address@domain.invalid wrote:

I am at a loss here and hoping for some advise on where to begin looking
with a series of errors I am suddenly getting when trying to rake:
“anything goes here” …

lil-loco:/rails/cem craigmartin$ rake db:migrate
(in /rails/cem)
rake aborted!
Permission denied - /rails/cem/db/schema.rb

Does /rails/cem/db exist? Is it writable by your user?

Can you do something like:

touch /rails/cem/db/schema.rb ?


Greg D.
http://destiney.com/

Hi Greg, thanks for the reply.
No, I get the same permissions error.

lil-loco:/rails/cem craigmartin$ touch /rails/cem/db/schema.rb
touch: /rails/cem/db/schema.rb: Permission denied

The db does exist yes. The last thing I did was to do a :prepare on the
test db and run some tests. This may be a silly mistake on my part but
did I miss something after running the test? Is it possible to lock the
dev db when preparing the testing db?

Again, thanks for the reply.

Craig


#4

On Apr 1, 11:13 pm, Craig M. removed_email_address@domain.invalid
wrote:

Greg D. wrote:
No, I get the same permissions error.

lil-loco:/rails/cem craigmartin$ touch /rails/cem/db/schema.rb
touch: /rails/cem/db/schema.rb: Permission denied

The db does exist yes. The last thing I did was to do a :prepare on the
test db and run some tests. This may be a silly mistake on my part but
did I miss something after running the test? Is it possible to lock the
dev db when preparing the testing db?

You probably just ran a command as another user, and so the current
user can no longer touch that file. You should be able to sudo chown
it back to yourself (or it might be less hassle to just sudo rm it)

Fred


#5

Frederick C. wrote:

On Apr 1, 11:13�pm, Craig M. removed_email_address@domain.invalid
wrote:

Greg D. wrote:
No, I get the same permissions error.

lil-loco:/rails/cem craigmartin$ touch /rails/cem/db/schema.rb
touch: /rails/cem/db/schema.rb: Permission denied

The db does exist yes. The last thing I did was to do a :prepare on the
test db and run some tests. This may be a silly mistake on my part but
did I miss something after running the test? Is it possible to lock the
dev db when preparing the testing db?

You probably just ran a command as another user, and so the current
user can no longer touch that file. You should be able to sudo chown
it back to yourself (or it might be less hassle to just sudo rm it)

Fred

sudo was the charm Fred thanks! You get the gold star for the day. :wink:

  • craig