0

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

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

所以我的问题是我该如何解决这个问题?上传未经处理的图像100%。但问题在于我认为的处理。所以回形针需要ImageMagick来处理图像。

问题是我使用App Engine灵活环境,所以我不知道如何安装它。我已经试过apt-get install imageMagick

回答

0

好吧真的很简单,你只需要一个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它会为你工作。

不要忘了在app.yamlruntime: rubyruntime: custom

改变就是它编码快乐