在我的rails3应用程序中,我通过命令“rails plugin install acts_as_taggable_on_steroids”安装了acts_as_taggable_on_steroids并且已经安装,但是现在迁移给了我这个问题。
我运行“rails generate acts_as_taggable_migration”,但错误来了“找不到生成器acts_as_taggable_migration”,请帮忙
答案 0 :(得分:4)
设法通过3个步骤找出解决方法:
1)$ rails generate migration acts_as_taggable
invoke active_record
create db/migrate/20110710214842_acts_as_taggable.rb
invoke active_record
create db/migrate/20110710214842_acts_as_taggable.rb
2)覆盖迁移信息
$ cat lib / ruby / gems / 1.8 / gems / acts_as_taggable_on_steroids-1.2 / generators / acts_as_taggable_migration / templates / migration.rb> 20110710223844_acts_as_taggable_migration.rb
3)迁移
使用
$ rake db:migrate
(in c:/Sites/bon)
== ActsAsTaggable: migrating =================================================
== ActsAsTaggable: migrated (0.0000s) ========================================
== ActsAsTaggableMigration: migrating ========================================
-- create_table(:tags)
-> 0.0020s
-- create_table(:taggings)
-> 0.0010s
-- add_index(:taggings, :tag_id)
-> 0.0010s
-- add_index(:taggings, [:taggable_id, :taggable_type])
-> 0.0010s
== ActsAsTaggableMigration: migrated (0.0140s) ===============================
验证
答案 1 :(得分:1)
最新版本的rails(3.0 +)的安装迁移注释已更改:
# For the latest versions :
rake acts_as_taggable_on_engine:install:migrations
答案 2 :(得分:0)
这解决了我的问题,与上述问题相同。
rails generate migration acts_as_taggable
rake acts_as_taggable_on_engine:install:migrations