简体   繁体   中英

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 project 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM