Heroku - 只读文件系统 - / var / www?

时间:2011-08-04 23:19:24

标签: ruby-on-rails ruby deployment

我正在尝试迁移数据库,我收到此错误..

heroku rake db:migrate
(in /app)
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
rake aborted!
Read-only file system - /var/www
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
/app/config/initializers/setup_shared_data.rb:6:in `<top (required)>'
/app/vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `load'
/app/vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `load_with_new_constant_marking'
/app/vendor/rails/railties/lib/initializer.rb:622:in `block in load_application_initializers'
/app/vendor/rails/railties/lib/initializer.rb:621:in `each'
/app/vendor/rails/railties/lib/initializer.rb:621:in `load_application_initializers'
/app/vendor/rails/railties/lib/initializer.rb:176:in `process'
/app/vendor/rails/railties/lib/initializer.rb:113:in `run'
/app/config/environment.rb:9:in `<top (required)>'

我如何解决这个问题,或者我该怎样做才能深入挖掘......

3 个答案:

答案 0 :(得分:4)

看起来/app/config/initializers/setup_shared_data.rb的第6行正在尝试在本地文件系统上创建一个目录(这就是mkdir)。

Heroku上不允许这样做,因为文件系统是只读的(/tmp除外)。有关此限制的详细信息,请参阅文档here

在您的问题中添加该行,也许我可以提供更具体的答案。

答案 1 :(得分:1)

关于rdoctask被弃用...考虑添加:

`gem 'rdoc'` 

到您的Gemfile。或者,您可以将rdoc /添加到.gitignore。

另一种方法是编辑你的Rakefile:

require 'rdoc/task'
RDoc::Task.new do |rdoc|

如果您可以发布您的Gemfile,将会很有帮助。

答案 2 :(得分:-2)

1 [读/写] [2]

heroku运行bash -a yourapplication 并更改chmod 777 -R文件夹或chmod 777 -R文件