#やりたいこと
AWS上でrakeを使いたい。
#環境
ruby 2.3.6
rails 5.1.4'
AMI Amazon Linax(無料枠のです)
RDSは使っていません。
#問題の箇所までの流れ
コンソールでおこなうAWSの設定は全て済。
/var/www/rails/***のプロジェクトディレクトリも作り、pullされた状態。
gemにRmagickを入れてます。
以下全てAWS上です。
$bundle install
Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found checking for outdated ImageMagick version (<= 6.4.9)... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. An error occurred while installing rmagick (2.16.0), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.16.0'` succeeds before bundling.
のエラーがでたので
まずbrewを入れた
http://linuxbrew.sh/
$sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
$test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH" $test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH" $test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile $echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile
bundle installのエラー取り。
$brew install pkg-config
$brew install imagemagick@6 $brew link --force imagemagick@6 $gem install rmagick
$bundle install → 解決。
production環境用にシークレットキー作成。
$rake secret
rake aborted! LoadError: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/linuxbrew/.linuxbrew/lib/libpng16.so.16) - /home/yudai/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0/lib/RMagick2.so /var/www/rails/***アプリ名***/config/application.rb:7:in `<top (required)>' /var/www/rails/***アプリ名***/Rakefile:4:in `require_relative' /var/www/rails/***アプリ名***/Rakefile:4:in `<top (required)>' (See full trace by running task with --trace)
このエラーが出たあと、にっちもさっちもいかなくなりました。
どなたか助け舟だしていただけたら嬉しいです。
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー