I could not reproduce the Friendship error on my machine. However, I
was able to get the same message by trying the generate a resource
called ActiveRecord. The message comes from raise_class_collision in
commands.rb:
def raise_class_collision(class_name)
message = <<end_message
The name '#{class_name}' is reserved by Ruby on Rails.
Please choose an alternative and run this generator again.
end_message
...
This only gets called from one place, class_collisions in the same
file:
# If the last Module exists, check whether the given
# class exists and raise a collision if so.
if last and last.const_defined?(name.camelize)
raise_class_collision(class_name)
end
So somewhere you have a class/module named Friendship already loaded
when the generator runs. This could be from a plugin, gem, lib class,
etc... you have loaded. The "reserved by Ruby on Rails" is a bit
misleading. It could be from Rails, but it also could be from a
number of other places.