refinerycms image not loading - dragonfly error

前端 未结 4 574
花落未央
花落未央 2021-01-12 06:57

I\'m working on developing a refinerycms rails app that was working good locally and now i\'ve moved it to my VPS and I was having issues with images that i uploaded through

相关标签:
4条回答
  • 2021-01-12 07:08

    I simply reinstalled imagemagick and it worked.

    0 讨论(0)
  • 2021-01-12 07:25

    I created a symbolic link from /usr/bin/convert -> /usr/local/bin/convert and from /usr/bin/identify -> /usr/local/bin/identify and that seemed to solve my problems.

    $ cd /usr/bin
    $ ln -s /usr/local/bin/convert convert
    $ ln -s /usr/local/bin/identify identify 
    

    I'm assuming that dragonfly is still not picking up my location of convert and identify even though i specified it in my config/application.rb file.

    0 讨论(0)
  • 2021-01-12 07:27

    Try installing the refinery-images gem:

    Gemfile:
       gem 'refinerycms-page-images', '~>1.0.3' //refinery v1 compatible (v2 available also)
    

    Then in your model:

    belongs_to :imagesizeyouwant, :class_name => 'Image'
    

    If you look at the Image class you'll see a pretty nice set up for handling images. You can add image sizes in Refinery's Settings page in the admin tool. If you have a custom engine, just change :imagesizeyouwant to that size (mine was :thumbnail).

    When you post the image, look at the output of the identify command and try to run it on your own. Chances are your system has different parameters it uses for ImageMagick binaries, or that the dimensions being sent to it are not understood. Try posting the output of the actual command Dragonfly is calling in the shell so we can take a better look.

    0 讨论(0)
  • 2021-01-12 07:29

    You may have to provide the full path to convert:

    config/initializers/dragonfly.rb:
    
    app.configure do |c|
      c.convert_command = "/usr/bin/convert"
    end
    

    Change /usr/bin/convert to the correct path to convert, which you can find out by running whereis convert on your VPS shell.

    More details in the documentation.

    0 讨论(0)
提交回复
热议问题