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

insert_add_column_or_create_table.rb:9:in unprepend': private method split' called for #<Array:0x1011e9d60> (NoMethodError) #18

Open
mirrorwis opened this issue Sep 27, 2010 · 4 comments

Comments

@mirrorwis
Copy link

/Users/Andy/Library/Application Support/TextMate/Pristine Copy/Bundles/Ruby on Rails.tmbundle/Support/bin/insert_add_column_or_create_table.rb:9:in unprepend': private methodsplit' called for #Array:0x1011e9d60 (NoMethodError)
from /Users/Andy/Library/Application Support/TextMate/Pristine Copy/Bundles/Ruby on Rails.tmbundle/Support/bin/insert_add_column_or_create_table.rb:54

RVM 1.8.7
Rails 2.3.8

@wulffeld
Copy link

Changing the unprepend method to:

def unprepend(text, prefix)
  text.map { |line| line.index(prefix) == 0 ? line.sub(prefix, '') : line }.join
end

seems to fix the bug.

@bquorning
Copy link

Thanks wulffeld, fixed the issue here as well :-)

@mtodd
Copy link

mtodd commented Mar 12, 2011

Same as well. Has not been merged into master but should.

I might just add this in there, though:

text = text.split("\n") if text.responds_to?(:split)

@michaelkoper
Copy link

Thanks this fixed it for me too.

Rails 2.1
Ruby 1.8.7

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

5 participants