From cc101f582d14a2cfc74859a537df8b34b017cc8f Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Fri, 18 Oct 2019 16:25:30 +0100 Subject: [PATCH] Fix installation instructions for Mac OS X The installation of `libxml-ruby` was broken because it was picking up the system version of the libxml2 library. By setting a `bundler` config item, it's possible to point it to the right place. Also updated the instructions for `phantomjs`, which Homebrew has moved to a cask (and is now not officially supported), and added some of the extra command line tools that are used (`pngcrush`, `optipng`, etc...) --- INSTALL.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index cdf3bc556..597940f0b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -71,6 +71,7 @@ For MacOSX, you will need XCode installed from the Mac App Store; OS X 10.7 (Lio Installing PostgreSQL: * Install Postgres.app from https://postgresapp.com/ +* Make sure that you've initialized and started Postgresql from the app (there should be a little elephant icon in your systray). * Add PostgreSQL to your path, by editing your profile: `nano ~/.profile` @@ -79,14 +80,37 @@ and adding: `export PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH` +After this, you may need to start a new shell window, or source the profile again by running `. ~/.profile`. + Installing other dependencies: * Install Homebrew from https://brew.sh/ * Install the latest version of Ruby: `brew install ruby` * Install ImageMagick: `brew install imagemagick` -* Install libxml2: `brew install libxml2 --with-xml2-config` -* If you want to run the tests, you need `phantomjs` as well: `brew install phantomjs` -* Install Bundler: `gem install bundler` +* Install libxml2: `brew install libxml2` +* Install libgd: `brew install gd` +* Install Yarn: `brew install yarn` +* Install pngcrush: `brew install pngcrush` +* Install optipng: `brew install optipng` +* Install pngquant: `brew install pngquant` +* Install jhead: `brew install jhead` +* Install jpegoptim: `brew install jpegoptim` +* Install gifsicle: `brew install gifsicle` +* Install svgo: `brew install svgo` +* Install Bundler: `gem install bundler` (you might need to `sudo gem install bundler` if you get an error about permissions) + +You will need to tell `bundler` that `libxml2` is installed in a Homebrew location. If it uses the system-installed one then you will get errors installing the `libxml-ruby` gem later on. + +``` +bundle config build.libxml-ruby --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config +``` + +If you want to run the tests, you need `phantomjs` as well: + +``` +brew tap homebrew/cask +brew cask install phantomjs +``` Note that OS X does not have a /home directory by default, so if you are using the GPX functions, you will need to change the directories specified in config/application.yml. -- 2.43.2