Mini_magick

Good afternoon,
I’m trying to solve a problem with imagemagick, with a mini_magick gem. When I run the tests, I get the error:
Failures:

  1) FileConvertService#call convert to png
     Failure/Error: @image ||= MiniMagick::Image.open(file_path)
     
     MiniMagick::Invalid:
       `identify /tmp/mini_magick20181001-171-iouzgk.ai` failed with error:
     # ./app/services/file_convert_service.rb:25:in `image'
     # ./app/services/file_convert_service.rb:14:in `call'
     # ./spec/services/file_convert_service_spec.rb:12:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # MiniMagick::Error:
     #   `identify /tmp/mini_magick20181001-171-iouzgk.ai` failed with error:
     #   ./app/services/file_convert_service.rb:25:in `image'

Finished in 7.52 seconds (files took 6.38 seconds to load)
361 examples, 1 failure, 13 pending

Failed examples:

rspec ./spec/services/file_convert_service_spec.rb:11 # FileConvertService#call convert to png

Coverage report generated for RSpec to /home/circleci/project/coverage. 308 / 376 LOC (81.91%) covered.
Exited with code 1

Local tests are excellent.

# Ruby CircleCI 2.0 configuration file
version: 2 # use CircleCI 2.0
jobs: # a collection of steps
  build: # runs not using Workflows must have a `build` job as entry point
    docker: # run the steps with Docker
      - image: circleci/ruby:2.5.1-node-browsers # ...with this image as the primary container; this is where all `steps` will run
        environment: # environment variables for primary container
          BUNDLE_PATH: vendor/bundle
          PGHOST: 127.0.0.1
          PGUSER: circleci-demo-ruby
          PGPASS: ''
          PGDATABASE: rails_blog
          RAILS_ENV: test
      - image: circleci/postgres:10.5-alpine-postgis-ram # database image
        environment: # environment variables for database
          POSTGRES_USER: circleci-demo-ruby
          POSTGRES_DB: rails_blog
          POSTGRES_PASSWORD: ''
    steps: # a collection of executable commands
      - checkout # special step to check out source code to working directory

      # Which version of bundler?
      - run:
          name: Which bundler?
          command: bundle -v

      # Restore bundle cache
      - restore_cache:
          keys:
            - rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
            - rails-demo-bundle-v2-

      - run:
          name: Bundle Install
          command: bundle check || bundle install

      # Store bundle cache
      - save_cache:
          key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - run:
          name: Create folder for result
          command: mkdir test_results

      - run:
          name: Wait for DB
          command: dockerize -wait tcp://localhost:5432 -timeout 1m

      - run:
          name: Copy database.yml
          command: mv config/database.yml.sample config/database.yml

      - run:
          name: Database setup
          command: bin/rails db:schema:load --trace

      - run:
          name: Run rspec
          command: bundle exec rspec

      # Save test results for timing analysis
      - store_test_results:
          path: test_results
      # See https://circleci.com/docs/2.0/deployment-integrations/ for example deploy configs
workflows:
  version: 2
  build:
    jobs:
      - build

This seems icloud be an interesting subject gimp of discussion.

Regards,
Brian.

It looks like the identify binary failed. Try getting a post-fail SSH session and run this command on the console. If the temporary file (/tmp/mini_magick20181001-171-iouzgk.ai) is still there, try adding that?

The main issue could be: did you install ImageMagick?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.