1

i built a simple sitemap with the gem sitemap generator. It is supposed to list the job pages of my application. E.g. www.mydomain.com/vacancies/24

There is a bug that I cannot fix myself for days:

It shows the wrong indexes (that do not exist). E.g. www.mydomain.com/vacancies/645 enter code hereHere is my sitemap.rb file:

require 'rubygems'
require 'sitemap_generator'

SitemapGenerator::Sitemap.default_host = "http://www.frankfurtstartupjobs.com"

SitemapGenerator::Sitemap.create do

  Vacancy.find_each do |vacancy|
    add vacancy_path(vacancy), :lastmod => vacancy.updated_at, :priority => 0.5
  end
end
Machavity
  • 30,841
  • 27
  • 92
  • 100
Sabrina
  • 309
  • 1
  • 14
  • Are you sure that they do not exist? This shouldn't have anything to do with the sitemap_generator. Check what's the result of `Vacancy.find_each` and double check it agains the actual records in the db. – Mladen Ilić Dec 06 '18 at 12:37
  • Vacancy.find_each give me the right ones. E.g. job with the id 30. But my sitemap shows. id 640. How do I check it against the actual record in the db??. I thought Vacancy.find_each gives me exactly that. Or is that something different? – Sabrina Dec 06 '18 at 12:42
  • I mean, you have to be overlooking something. :) Are you sure you generated the sitemap in the correct environment and that you are not tracking it through vcs? – Mladen Ilić Dec 06 '18 at 12:48
  • I generated it via the command "heroku run rake sitemap:install". Is that correct? I mean that should be correct running it via the server right? – Sabrina Dec 06 '18 at 13:06
  • No, you should use `heroku run rake sitemap:refresh`. Here's the doc https://github.com/kjvarga/sitemap_generator#rake-tasks – Mladen Ilić Dec 06 '18 at 13:08
  • I initially installed it. But after that also used "heroku run rake sitemap:refresh". But it is still the wrong index. – Sabrina Dec 06 '18 at 13:13

0 Answers0