Google Cloud上的ImageMagick

我在Google云端平台上使用ImageMagick。 我使用rails和Google的App Engine灵活环境。 所以问题是我想上传一个Image来处理更多尺寸。 我用回形针。 错误是:

无法运行identify命令。 请安装ImageMagick。

所以我的问题是如何解决这个问题? 上传图像而不进行处理100%。 但问题是我认为的处理。 因此,回形针需要ImageMagick来处理图像。

问题是我使用App Engine Flexible Environment,所以我不确定如何安装它。 我已经尝试使用apt-get install imageMagick

好的,你只需要一个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 

之后,只需运行gcloud preview app deploy ,它就会对你gcloud preview app deploy

不要忘记在app.yaml runtime: ruby更改runtime: rubyruntime: custom

这就是编码happy