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.
44d60db8268d92f862c28bd02ec1009b?d=identicon&s=25 Craig Martin (mucho_craig)
on 2009-04-01 23: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.
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2009-04-01 23:38
(Received via mailing list)
On Wed, Apr 1, 2009 at 4:33 PM, Craig Martin
<rails-mailing-list@andreas-s.net> 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 Donald
http://destiney.com/
44d60db8268d92f862c28bd02ec1009b?d=identicon&s=25 Craig Martin (mucho_craig)
on 2009-04-02 00:13
Greg Donald wrote:
> On Wed, Apr 1, 2009 at 4:33 PM, Craig Martin
> <rails-mailing-list@andreas-s.net> 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 Donald
> 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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-02 00:38
(Received via mailing list)
On Apr 1, 11:13 pm, Craig Martin <rails-mailing-l...@andreas-s.net>
wrote:
> Greg Donald 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
44d60db8268d92f862c28bd02ec1009b?d=identicon&s=25 Craig Martin (mucho_craig)
on 2009-04-02 00:54
Frederick Cheung wrote:
> On Apr 1, 11:13�pm, Craig Martin <rails-mailing-l...@andreas-s.net>
> wrote:
>> Greg Donald 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.