For a project on Rails 4.2.5 , a gem CarrierWave was installed. When creating a new object and loading the image, no errors occurred.

After installing gem RailsAdmin when trying to create a new object with a picture, the following error occurs:

 ArgumentError in RailsAdmin::MainController#new wrong number of arguments (1 for 0) Extracted source (around line #115): 113 # 114 # This method is not thread-safe. 115 def quietly 116 ActiveSupport::Deprecation.warn( 117 "`#quietly` is deprecated and will be removed in the next release." 118 ) #not thread-safe 

Screenshot

Tell me what could be the reason?

  • one
    The gems clearly fought over the callbacks of the model, with the result that someone called quietly , not accepting any arguments, with one argument. Take a debugger, get to the one who did it and ... well, further depending on what you find. - D-side

1 answer 1

The problem is solved in the following way:

In the file image_uploader.rb (the file name is taken from my project, you may have it different), we find the following lines and comment on them:

 # Create different versions of your uploaded files: # version :thumb do # process :resize_to_fit => [50, 50] # end # 
  • That is, just throwing away the ability to create thumbnails? Strange decision. - D-side
  • I can be wrong, but as far as I understand they should be written in rails_admin.rb there is the following comment in the code: field: asset do thumb_method: large # set the method for your asset (defaults to: thumb,: thumbnail or '100x100>' for Dragonfly). - Alexandr Dmitrenko