Setting up the EBW tools on Mac OSX
These steps have worked for us on several machines. Every machine is a bit different, so your mileage may vary.
On Windows? I've written up guidance for installing on Windows here.
Install Homebrew (without XCode -- you do not need to install XCode!). This is done in two steps from the Terminal. See ryanwinchester.ca/posts/installing-homebrew-without-xcode. Essentially:
- Install XCode developer tools (lets Homebrew work):
- Install Homebrew (lets you install things easily):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
On some systems, this doesn't work and you need to include the full path to Ruby:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install the latest Ruby:
brew install ruby
To check whether that worked, enter
ruby --version. If it doesn't list a recent version of Ruby (2.4 or later), you may have to add the new version to your PATH.
gem install jekyll
gem install bundler
To check that Bundler is installed, enter:
If it isn't, you may need to add the path to your gems to your PATH. To do this, first run
gem environmentto get the directory of the
executable directory, which may look like
/usr/local/lib/ruby/gems/2.5.0/bin. To add that to your path, you add
export PATH= /usr/local/lib/ruby/gems/2.5.0/bin:$PATHto your
~/.bash_profilefile. (This discussion has some more detail.)
Download and install PrinceXML. See princexml.com/doc/installing for instructions. Note that this is proprietary software (the only proprietary tool we use). You can try the trial version for free; it adds a watermark to your first page.
Install PhantomJS. This is necessary for building search indexes for websites. (And, in older repos to Electric Book template version 0.12, for creating PDFs that contain maths.) Download from phantomjs.org. Extract the zip archive and copy the
phantomjsexecutable file in
binto your machine's
Install Pandoc if you're going to export to Word:
brew install pandoc
Install Git for version control. If you're new to Git, try GitHub Desktop. (Git isn't easy to understand at first, but it's worth the effort.)
Install Gulp and Graphicsmagick. We use these to create multi-format images. To do this:
npm install --global gulp-cli
brew install graphicsmagick --with-little-cms2
Note that if you have already installed GraphicsMagick but without specifying
--with-little-cms2, you will need to
brew uninstall graphicsmagickfirst. Little CMS is required for managing colour profiles during image conversions, but it is not installed by default.
If you also want to create apps, you will need to install:
The Electric Book scripts will use these in the background, and for some build steps you'll have to use these directly.