lundi 20 juillet 2015

Rails friendly_id: undefined method `slug` on production

I'm trying to introduce dynamic_sitemaps over resources with friendly_id. The issue is the production rails (rake / rails c) doesn't see the slug method. I've try to specify it by force by specifying an attr_accessible :slug, but it doesn't help either.

$ rake sitemap:generate
Generating sitemap...
rake aborted!
undefined method `slug' for #<Article:0xa9e4d14>

The funny thing it works smoothly on the local environment, and it should not be so much different with the capistrano/rvm deployment.

The column exists in the DB and is used by the rails app itself (which works fine too).

Added: it should be tied to either the environment or the specific gem version issue, but I'm not sure which one is the trouble, and how to debug it. The same pair works good for a different project with a pretty similar libraries bundle.

Aucun commentaire:

Enregistrer un commentaire