The Name is Either Already Used or Reserved by Ruby on Rails

Hey everyone,

I ran into the following error while attempting to create a new model called calendar today:

chris@chris-VirtualBox:~/calendar$ rails g model calendar
      invoke  active_record
      The name 'Calendar' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.

It turns out that this was due to the fact that my application was also called Calendar. In order to get around this I decided to rename the application. This required a little bit of searching and thanks to this Stackoverflow post I found references in the following files:

– config/application.rb
– config/environment.rb
– config/environments/development.rb
– config/environments/production.rb
– config/environments/test.rb
– config/initializers/secret_token.rb
– config/initializers/session_store.rb
– config/mongoid.yml (if using Mongoid)
– config/routes.rb
– Rakefile
– app/views/layouts/application.html.erb, in title tag
– initializers/secret_token.rb
– initializers/session_store.rb

Let me know if you find any more spots that I’ve missed!

One thought on “The Name is Either Already Used or Reserved by Ruby on Rails

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.