Ruby 1.8.7 - Ruby 1.9.2 and Rails 3.0.0 'Encoding' Model Name Conflict
I have a Rails 3.0.0 application that has a model named 'Encoding' and is currently running on 1.8.7 fine. I'm trying to upgrade to 1.9.2, but the name 'Encoding' is conflicting with that version of Ruby.
I tried creating a new project, and when running rails g model encoding
with 1.9.2 it complains giving:
The name 'Encoding' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
When I originally created the proje开发者_运维百科ct under 1.8.7, the generator didn't complain. Do I have any options to upgrade to Ruby 1.9.2 without having to rename my models and tables? Perhaps some sort of name spacing? Thanks.
Encoding is a class that was introduced in ruby 1.9. Change your model name.
精彩评论