开发者

could not find generator acts_as_taggable_migration

in my rails3 app i installed acts_as_tagg开发者_如何转开发able_on_steroids through command "rails plugin install acts_as_taggable_on_steroids" and it got installed,but now the migration give me the problem.

I run "rails generate acts_as_taggable_migration",but the error comes "could not find generator acts_as_taggable_migration", please help


manage to figure out a workaround in 3 steps:

1) $ rails generate migration acts_as_taggable

  invoke  active_record
  create    db/migrate/20110710214842_acts_as_taggable.rb

2) Overwrite with migration info
$ 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) Migrate


$ 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) ===============================

validate with $ rake db:migration:status


The install migration comment for the latest version of rails (3.0 +) has changed:

# For the latest versions :
rake acts_as_taggable_on_engine:install:migrations

Details on acts as taggable on Github project


This solved my issue which was the same as the question above.

rails generate migration acts_as_taggable
rake acts_as_taggable_on_engine:install:migrations

Link to github documentation https://github.com/mbleigh/acts-as-taggable-on

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜