2011-08-04 71 views
1

我試圖遷移的數據庫,我得到這個錯誤..Heroku - 只讀文件系統 -/var/www?

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)>' 

我如何解決這個問題或者我能做些什麼在這個更深層次的挖掘....

回答

4

它看起來像/app/config/initializers/setup_shared_data.rb第6行正試圖在本地文件系統上創建一個目錄(這就是mkdir)。

Heroku不允許這樣做,因爲文件系統是隻讀的(/tmp除外)。有關此限制的更多信息,請參閱文檔here

將此行添加到您的問題中,也許我可以提供更具體的答案。

1

至於rdoctask被棄用...考慮增加:

`gem 'rdoc'` 

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

另一種方法是編輯您的Rake文件:

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

這將是有益的,如果你可以發表你的Gemfile。

-2

1 [讀/寫] [2]

heroku上運行的bash -a yourapplication 和變化搭配chmod 777 -R文件夾或搭配chmod 777 -R文件

相關問題