Broken Images Under "Media", also unable to install v10


(Maceo) #1

This CMS looks great and is much needed, strange that no one has cracked this yet.

Anyway, what I noticed on both v8.x and v 9.x releases (using Rails 4.2.7) is that the images shown on the Media page show broken image icons.

The reason for this appears to be the addition of the “style” param when the page calls the images to display the contents of the media library.

This works:
http://localhost:5000/media/2016/12/23/3bv9ab0hqa_my_image.JPG

This does not:
http://localhost:5000/media/2016/12/23/3bv9ab0hqa_my_image.JPG?style=push_type_thumb

Dragonfly::Shell::CommandFailed
Command failed ('identify' '-ping' '-format' '%m %w %h' '/Users/maceo/Projects/testcms/public/system/dragonfly/development/2016/12/23/3bv9ab0hqa_my_image.JPG') with exit status 127 and stderr sh: identify: command not found

I assumed this was fixed in v10 but wasn’t able to get v10.x to run, unfortunately, having received the following error:

/Users/maceo/.rvm/gems/ruby-2.2.5@testcms/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:477:in `load': /Users/maceo/.rvm/gems/ruby-2.2.5@testcms/gems/push_type_auth-0.10.2/app/controllers/concerns/push_type/api_authentication_methods.rb:26: syntax error, unexpected '.' (SyntaxError)
11:46:05 web.1  |       params[:token] || request.headers['Authorization']&.split&.last

I’m interested in finding a solution to either or both of these issues, if anyone has any tips. Thanks!


Linked assets creates broken link
(Aaron Russell) #2

Hi there @subcom both these issues seem to be to do with your environment.

Dragonfly::Shell::CommandFailed
Command failed ('identify' '-ping' '-format' '%m %w %h' '/Users/maceo/Projects/testcms/public/system/dragonfly/development/2016/12/23/3bv9ab0hqa_my_image.JPG') with exit status 127 and stderr sh: identify: command not found

PushType dynamically resizes images on the fly, and for this it needs imagemagick installed on your system. What OS are you using? If MacOS, use homebrew and install with brew install imagemagick, if on linux then use your package manager of choice - eg sudo apt-get install imagemagick. Windows I’m not sure.

/Users/maceo/.rvm/gems/ruby-2.2.5@testcms/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:477:in `load': /Users/maceo/.rvm/gems/ruby-2.2.5@testcms/gems/push_type_auth-0.10.2/app/controllers/concerns/push_type/api_authentication_methods.rb:26: syntax error, unexpected '.' (SyntaxError)
11:46:05 web.1  |       params[:token] || request.headers['Authorization']&.split&.last

This is due to the use of the safe navigation operator syntax - .& - which is a Ruby 2.3+ feature. I might refactor that as it’s easy to write that line in a way that is friendly with Ruby 2.2, but for now you’re easiest option is to upgrade Ruby to the latest version. If you’re using RVM or Rbenv just install the latest Ruby and try with that.

Hope this helps.