我正在为我的网站生成站点地图并将其临时保存到 tmp 文件夹,然后上传到我的亚马逊 AWS 账户。我正在使用站点地图生成器和雾宝石来帮助我。到目前为止,我有这个...
# In sitemap.rb
# Set the host name for URL creation
SitemapGenerator::Sitemap.default_host = "http://mycoolapp.com/"
# pick a place safe to write the files
#SitemapGenerator::Sitemap.public_path = 'tmp/'
# store on S3 using Fog
SitemapGenerator::Sitemap.adapter = SitemapGenerator::S3Adapter.new
# inform the map cross-linking where to find the other maps
SitemapGenerator::Sitemap.sitemaps_host = "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com/"
# pick a namespace within your bucket to organize your maps
SitemapGenerator::Sitemap.sitemaps_path = '/'
SitemapGenerator::Sitemap.create do
# Put links creation logic here.
#
add '/home'
add '/about'
add '/contact'
end
每当我运行时,heroku run rake sitemap:create
我都会收到以下错误...
In '/app/tmp/':
511
rake aborted!
Read-only file system - /sitemap.xml.gz
我真的不知道为什么它不起作用。我什至确保 tmp 文件夹是通过Rails.root.join('tmp')
作为初始化程序运行来创建的。解决此问题的任何帮助将不胜感激。