Forum: Ruby on Rails permission denied errors with rake db:migrate

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Craig M. (Guest)
on 2009-04-02 01:33
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.
Greg D. (Guest)
on 2009-04-02 01:38
(Received via mailing list)
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/
Craig M. (Guest)
on 2009-04-02 02:13
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
Frederick C. (Guest)
on 2009-04-02 02:38
(Received via mailing list)
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
Craig M. (Guest)
on 2009-04-02 02:54
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. ;-)

- craig
This topic is locked and can not be replied to.