【发布时间】:2011-09-25 11:16:12
【问题描述】:
我在 Heroku 上收到此错误:
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m Rendered admin/xml/index.rhtml wi
thin layouts/admin (87.7ms)
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m Completed in 89ms
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m ActionView::Template::Error (Perm
ission denied - /app/public/xml/preview.xml):
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m 1: <% update_xml("preview") %
>
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m 2:
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m 3:
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m 4: <h2>Preview/publish</h2>
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m app/helpers/admin/xml_helper.rb
:88:in `initialize'
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m app/helpers/admin/xml_helper.rb
:88:in `open'
←[36m2011-09-25T00:24:51+00:00 app[web.1]:←[0m app/helpers/admin/xml_helper.rb
我的助手:
File.open("#{RAILS_ROOT}/public/xml/#{output}.xml", "w") do |f|
f.puts("<?xml version='1.0' encoding='UTF-8'?>")
f.puts("<site>")
f.puts("<general name='general' type='general'><imagePath>photographer/image/</imagePath><moviePath>../photographer/flv/</moviePath></general>")
f.puts("#{xmlmenu.to_xml}")
f.puts("#{xmlmovies.to_xml}")
f.puts("#{xmltextpages.to_xml}")
f.puts("</site>")
end
end
如何解决这个问题? 或者如何使用亚马逊 S3 创建这个打开的文件并进行身份验证。
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 heroku