Google Cloud上的ImageMagick [英] ImageMagick on Google Cloud

查看:144
本文介绍了Google Cloud上的ImageMagick的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I use ImageMagick on the Google Cloud Platform. I use rails and Google's App Engine Flexible Environment. So the problem is I want to upload an Image to process in more sizes. I use paperclip. The error is:


无法运行标识命令。请安装ImageMagick。

Could not run the identify command. Please install ImageMagick.

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

So my question is how I can solve this issue? Uploading a Image without processing works 100%. But the issue is the processing I think. So paperclip needs ImageMagick to process the images.

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

The problem is I use App Engine Flexible Environment so I am not sure how to install it. I already tried it with apt-get install imageMagick

推荐答案

好的,真的很简单你只需要一个Dockerfile。

Okay really simple you need just a 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预览应用程序部署,它将适合您。

After that just run gcloud preview app deploy and it will work for you.

不要忘记更改 app.yaml 运行时:ruby 运行时:自定义

这篇关于Google Cloud上的ImageMagick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆