I am developing a rails plugin. I have paperclip in the gemspec file:
spec.add_dependency 'paperclip', '~> 5.1'
After installing gems (using bundle install
), it shows that the paperclip gem is installed in the plugin.
After adding has_attached_file
in app/models/my_plugin/class_with_data_file_entity
:
class ClassWithDataFileEntity < ActiveRecord::Base
has_attached_file :file, url: "/:class/:attachment/:id_partition/:filename",
end
I see the following error:
undefined method `has_attached_file' for #<Class:0x0000000354e7e8>
So, the plugin can not find paperclip. Why would that be? Can Paperclip be used in a rails plugin