■acts-as-taggale-onにてMethod_misshingが出ており、その解決方法が知りたい
[1] pry(main)> Art
NameError: undefined local variable or method acts_as_taggable' for Art (call 'Art.connection' to establish a connection):Class from /Users/Shota/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in
method_missing'
■Gemへは追加済み
gem 'acts-as-taggable-on', '~> 3.4'
$ bundle show acts
/Users/Shota/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/acts-as-taggable-on-3.5.0
■Modelへも追記済み
class Art < ActiveRecord::Base
acts_as_taggable
■rake acts_as_taggable_on_engine:install:migrations実行時のメッセージ
$ rake acts_as_taggable_on_engine:install:migrations
Copied migration 20160127022955_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160127022956_add_missing_unique_indices.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160127022957_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160127022958_add_missing_taggable_index.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160127022959_change_collation_for_tag_names.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
■rake db:migrateion実行時のメッセージ
a$ rake db:migrate
== 20160127022955 ActsAsTaggableOnMigration: migrating ========================
-- create_table(:tags)
-> 0.0011s
-- create_table(:taggings)
-> 0.0003s
-- add_index(:taggings, :tag_id)
-> 0.0005s
-- add_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.0006s
== 20160127022955 ActsAsTaggableOnMigration: migrated (0.0026s) ===============
== 20160127022956 AddMissingUniqueIndices: migrating ==========================
-- add_index(:tags, :name, {:unique=>true})
-> 0.0025s
-- remove_index(:taggings, :tag_id)
-> 0.0022s
-- remove_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.0005s
-- add_index(:taggings, [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], {:unique=>true, :name=>"taggings_idx"})
-> 0.0004s
== 20160127022956 AddMissingUniqueIndices: migrated (0.0060s) =================
== 20160127022957 AddTaggingsCounterCacheToTags: migrating ====================
-- add_column(:tags, :taggings_count, :integer, {:default=>0})
-> 0.0012s
== 20160127022957 AddTaggingsCounterCacheToTags: migrated (0.0224s) ===========
== 20160127022958 AddMissingTaggableIndex: migrating ==========================
-- add_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.0019s
== 20160127022958 AddMissingTaggableIndex: migrated (0.0021s) =================
== 20160127022959 ChangeCollationForTagNames: migrating =======================
== 20160127022959 ChangeCollationForTagNames: migrated (0.0016s) ==============
すみません、原因が分からず、どのようにしたら良いかご教授いただけますと幸いです。
あなたの回答
tips
プレビュー