J'ai fait une application rails et ajouté la gemme acts-as-taggable-on, j'ai exécuté le rake db: migrate et ajouté le champ à Article.rb. Je semble obtenir cette erreur avec une application 5.1 rail. Je ne peux pas comprendre ce que c'est.acts_as_taggable_on Gem ne fonctionnait pas pour Rails 5
Gemfile
gem 'acts-as-taggable-on', '~> 4.0'
Article.rb
class Article < ApplicationRecord
include TheComments::Commentable
acts_as_taggable_on :tags
belongs_to :user
# Denormalization methods
# Check the documentation for information on advanced usage
def commentable_title
title
end
def commentable_url
['', self.class.to_s.tableize, id].join('/')
end
def commentable_state
:published.to_s
end
end
Cependant, je reçois cette erreur:
Running via Spring preloader in process 18395
Loading development environment (Rails 5.1.2)
2.4.0-rc1 :001 > Article
NoMethodError: undefined method `acts_as_taggable_on' for Article (call 'Article.connection' to establish a connection):Class
from app/models/article.rb:6:in `<class:Article>'
from app/models/article.rb:1:in `<top (required)>'
from (irb):1
2.4.0-rc1 :002 > Article
NoMethodError: undefined method `acts_as_taggable_on' for Article (call 'Article.connection' to establish a connection):Class
from app/models/article.rb:6:in `<class:Article>'
from app/models/article.rb:1:in `<top (required)>'
Avez-vous exécutez 'bundle install' après avoir ajouté le bijou à la Gemfile? Avez-vous redémarré la chaîne et l'application? – spickermann