0

Ich verwende ImageMagick auf der Google Cloud Platform. Ich verwende Rails und Google App Engine Flexible Environment. Also das Problem ist, ich möchte ein Bild hochladen, um in mehr Größen zu verarbeiten. Ich benutze Büroklammer. Der Fehler lautet:ImageMagick in Google Cloud

Der Befehl identify konnte nicht ausgeführt werden. Bitte installieren Sie ImageMagick.

Also meine Frage ist, wie ich dieses Problem lösen kann? Ein Bild ohne Bearbeitung hochzuladen funktioniert 100%. Aber das Problem ist die Verarbeitung, denke ich. Paperclip benötigt also ImageMagick, um die Bilder zu verarbeiten.

Das Problem ist, dass ich App Engine Flexible Environment verwende, so dass ich nicht sicher bin, wie ich es installieren soll. Ich habe es schon versucht mit apt-get install imageMagick

Antwort

0

Okay, wirklich einfach, Sie brauchen nur eine Dockerfile.

# This Dockerfile for a Ruby application was generated by gcloud. 

# The base Dockerfile installs: 
# * A number of packages needed by the Ruby runtime and by gems 
# commonly used in Ruby web apps (such as libsqlite3) 
# * A recent version of NodeJS 
# * A recent version of the standard Ruby runtime to use by default 
# * The bundler and foreman gems 
FROM gcr.io/google_appengine/ruby 

# Install ruby 2.3.0 if not already preinstalled by the base image 
RUN cd /rbenv/plugins/ruby-build && \ 
    git pull && \ 
    rbenv install -s 2.3.0 && \ 
    rbenv global 2.3.0 && \ 
    gem install -q --no-rdoc --no-ri bundler --version 1.11.2 && \ 
    gem install -q --no-rdoc --no-ri foreman --version 0.78.0 
ENV RBENV_VERSION 2.3.0 

# To install additional packages needed by your gems, uncomment 
# the "RUN apt-get update" and "RUN apt-get install" lines below 
# and specify your packages. 
# RUN apt-get update 
# RUN apt-get install imagemagick -y 
RUN apt-get update && apt-get install imagemagick -y 

# Install required gems. 
COPY Gemfile Gemfile.lock /app/ 
RUN bundle install && rbenv rehash 

# Start application on port 8080. 
COPY . /app/ 
ENTRYPOINT bundle exec rackup -p 8080 -E production config.ru 

Danach nur gcloud preview app deploy laufen und es wird für Sie arbeiten.

Vergessen Sie nicht in Ihrem app.yamlruntime: ruby-runtime: custom

zu ändern, das ist es glücklich Codierung