Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation of Mailcatcher using RVM and non-RVM #561

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions scripts/mailcatcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,39 @@ PHP_IS_INSTALLED=$1
apache2 -v > /dev/null 2>&1
APACHE_IS_INSTALLED=$?

# Installing dependency
# Source .profile for RVM, if available
if [[ -f "/home/vagrant/.profile" ]]; then
source /home/vagrant/.profile
fi

# Installing sqlite dependency
# -qq implies -y --force-yes
sudo apt-get install -qq libsqlite3-dev ruby1.9.1-dev
sudo apt-get install -qq libsqlite3-dev

if $(which rvm) -v > /dev/null 2>&1; then
echo ">>>>Installing with RVM"
$(which rvm) default@mailcatcher --create do gem install --no-rdoc --no-ri mailcatcher
$(which rvm) wrapper default@mailcatcher --no-prefix mailcatcher catchmail
else
# Installing ruby dependency
# -qq implies -y --force-yes
sudo apt-get install -qq ruby1.9.1-dev

# Gem check
if ! gem -v > /dev/null 2>&1; then sudo aptitude install -y libgemplugin-ruby; fi

# Install Mailcatcher gem dependencies, otherwise Ruby 2.0.0+ is required
gem install --no-rdoc --no-ri mail -v 2.6.3 # Last known working with Ruby < 2.0.0
gem install --no-rdoc --no-ri activesupport -v "~> 4.0"
gem install --no-rdoc --no-ri eventmachine -v 1.0.9.1
gem install --no-rdoc --no-ri rack -v "~> 1.5"
gem install --no-rdoc --no-ri sinatra -v "~> 1.2"
gem install --no-rdoc --no-ri skinny -v "~> 0.2.3"
gem install --no-rdoc --no-ri sqlite3 -v "~> 1.3"
gem install --no-rdoc --no-ri thin -v "~> 1.5.0"

# Install
gem install --no-rdoc --no-ri mailcatcher
gem install --no-rdoc --no-ri --ignore-dependencies mailcatcher -v "~> 0.6"
fi

# Make it start on boot
Expand Down