Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next_migration_number #11

Open
andrenth opened this issue Apr 9, 2010 · 8 comments
Open

next_migration_number #11

andrenth opened this issue Apr 9, 2010 · 8 comments

Comments

@andrenth
Copy link

andrenth commented Apr 9, 2010

Running "rails g wysihat" in rails 3 after installation gives me a NotImplementedError exception in the next_migration_number method. This method is defined under Rails::Generators::Migration::ClassMethods in the rails source, so changing it to be a class method in wysihat fixed it for me:

-def next_migration_number(dirname) #:nodoc:
+def self.next_migration_number(dirname) #:nodoc:
@blaines
Copy link

blaines commented May 16, 2010

That also worked for me! Thanks!

@onesup
Copy link

onesup commented Jun 23, 2010

.rvm/gems/ruby-1.9.2-head/gems/wysihat-engine-0.1.13/lib/generators/wysihat_generator.rb

@mrrooijen
Copy link

That fixed the generator for me as well! Thanks!

@slash4
Copy link

slash4 commented Jan 22, 2011

Fixed here too :)

@alantocheri
Copy link

I'm getting a similar error:

/Users/Alan/.rvm/gems/ruby-1.8.7-p302/gems/railties-3.0.1/lib/rails/generators/migration.rb:50:in migration_template': undefined methodnext_migration_number' for WysihatGenerator:Class (NoMethodError)
from /Users/Alan/.rvm/gems/ruby-1.8.7-p302/gems/wysihat-engine-0.1.13/lib/generators/wysihat_generator.rb:60:in `install_wysihat'

I've tried editing .rvm/gems/ruby-1.8.7-p302/gems/railties-3.0.1/lib/rails/generators/migration with the fix (changes happen on line #29) and it doesn't seem to make a difference.

Can I change the wysihat_generator.rb to fix it? I'm sure I'm doing something terribly wrong.

@stanislaw
Copy link

+1 to alantocheri

@stanislaw
Copy link

It seems, that commenting "raise NotImplementedError" in next_migration_number method solves issue.

Having it commented, all worked!

@alantocheri
Copy link

Although the error was coming from ruby-1.8.7-p302, I ended doing what stanislaw suggested in the /ruby-1.8.7-p302@rails3 directory. It must be a RVM thing. That seemed to 'work'. (thanks Stanislaw)

The issue now is that it created the migration file without a timestamp and rake seems to miss it. I just copied/pasted into a new migration - but wondering if there's a way to fix this problem and the generate issue for rails 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants