I have an almost new setup of ROR 3.1 here and have already generated 2 models (AdminUser and Advisor), when i try to add another model “Investor” I am getting this error:
“The name ‘Investor’ is either already used in your application or
reserved by Ruby on Rails. Please choose an alternative and run this
generator again.”
I am using command: rails g model Investor.
I have only two models in my project right now and non of them is called Investor…
FIXED:
It turned out that my application is called “Investor”; when I created rails app I did: rails new investor. I had to rename all the occurrences of the name of my app to a different name and it works now.
Here is a list of files you have to change:
- config.ru
- Rakefile
- config/application.rb
- config/environment.rb
- config/environments/development.rb
- config/environments/test.rb
- config/routes.rb
- config/initializers/secret_token.rb
- config/initializers/session_store.rb
It happened because my application was called “Investor” (same as the model I wanted to add), once I’ve changed my application name it started to work…