Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mailcatcherのレシピ(gem eventmachineをダウングレードして動かす)
# Cookbook Name:: app
# Recipe:: mailcatcher
#
# Copyright 2015, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
# rubyとgem は既に入っている想定
# ruby -v => 2.0.0p598
# gem -v => 2.0.14
# 下記 /usr/local/bin/gem 及び、IPは適宜書き換える
# mailcatcher install
# version 0.5.12
execute "mailcatcher install" do
user "root"
command "/usr/local/bin/gem install mailcatcher"
not_if "/usr/local/bin/gem list | grep mailcatcher"
end
# @link https://github.com/sj26/mailcatcher/issues/182#issuecomment-68647414
execute "gem install eventmachine -v 1.0.3" do
user "root"
command "/usr/local/bin/gem install eventmachine -v 1.0.3"
not_if "/usr/local/bin/gem list | grep \"eventmachine (1.0.3)\""
end
execute "gem uninstall eventmachine -v 1.0.4" do
user "root"
command "/usr/local/bin/gem uninstall eventmachine -v 1.0.4"
only_if "/usr/local/bin/gem list | grep \"eventmachine (1.0.4\""
end
# start
execute "mailcatcher --http-ip 192.168.30.10" do
command "mailcatcher --http-ip 192.168.30.10"
not_if "ps aux | grep [m]ailcatcher"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment