# Gem::FilePermissionError on "rails:freeze:gems" task

**URL:** <https://www.ruby-forum.com/t/gem-filepermissionerror-on-railsgems-task/187201>\
**Category:** Rails\
**Created:** [April 19, 2010, 6:38pm UTC](https://www.ruby-forum.com/t/gem-filepermissionerror-on-railsgems-task/187201 "2010-04-19T18:38:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomuhs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecb155/32.png) [@tomuhs](https://www.ruby-forum.com/u/tomuhs)\
**Post date:** [April 19, 2010, 6:38pm UTC](https://www.ruby-forum.com/t/gem-filepermissionerror-on-railsgems-task/187201/1 "2010-04-19T18:38:26Z")

</div>

My understanding is that the “rails:freeze:gems” task copies the Rails  
source into the application’s vendor directory. Which is why I find  
the following error surprising and confusing, because the task should  
not involve writing to system files or directories:

% rake rails:freeze:gems  
(in /Users/tallen/apps/pnc)  
Freezing to the gems for Rails 2.3.5  
rm -rf vendor/rails  
mkdir -p vendor/rails  
cd vendor/rails  
ERROR: While executing gem … (Gem::FilePermissionError)  
You don’t have write permissions into the /opt/local/lib/ruby/gems/  
1.8 directory.  
rm -rf vendor/rails

Why does the task want to write to that directory? The output was  
identical with the --trace option.

Thomas
