Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Setting up a developer environment

Jan Paul Posma edited this page May 15, 2014 · 1 revision

Use this page to set up your developer environment. If you are a new employee, you might also want to look at the New employee manual.

Factlink installation prerequisites

We'll use brew, npm and github to install most the code and most dependencies automatically, but before brew and git are ready to go, we'll need to set them up.

  • Install the latest Command Line Tools. You can also install the complete XCode; if you do, note that it doesn't come bundled with the GNU compilers anymore, so you need to open the settings pane in XCode and download and install gcc from there.
  • Generate an ssh key: ssh-keygen -t rsa. Add this key (~/.ssh/id_rsa.pub) to github. Alternatively, install any other ssh key github knows into your home directory.
  • Install java: You can do this by starting any program requiring java (such as Java VisualVM); Mac OS will ask to install java for you.
  • Install the DejaVu Sans Mono font (using Font Book in Mac OSX) if you want to be able to run screenshot tests locally. You can download the complete the DejaVu fonts package or just the sans mono variant from our google drive (filename: DejaVuSansMono.zip).
  • Git clone factlink/factlink
  • Run the appropriate environment setup script from the cloned directory.
  • Run bin/bootstrap from the cloned directory.
  • (No longer relevant?: set the right path in ~/.bash_profile: export NODE_PATH="/usr/local/lib/node_modules")

To run factlink locally, go into the core repo and start the database servers:

foreman start -f ProcfileServers

Then run the web servers in another terminal:

foreman start

Now navigate to localhost:3000 to start working! Good luck!

Debugging

The steps below were not written with the above script in mind, and are no longer current. But if things aren't working, perhaps it's still relevant...

OS X Mountain Lion (upgrading, might also be relevant for new install)

Upgrade/install according to this guide:

http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion (you can skip the homebrew/dupes and mysql)

Then these:

http://coderwall.com/p/dtbuqg ( starting from gcc configuration, including geinstall of ruby using rvm )

Then remove all gems:

$ gem list | cut -d" " -f1 | xargs gem uninstall -aIx'
$ brew remove imagemagick
$ brew install imagemagick

Check if imagemagick works by installing the rmagic gem:

$ gem install rmagick

Install some needed gems:

$ gem install foreman bundler resque rake

in the factlink/core

$ bundle install

Python: If you used virtualenvwrapper (and probably also virtualenv), you also need to reinstall this:

$ sudo easy_install virtualenvwrapper

If you have problems with nokogiri, you might try this:

$ brew install libiconv
$ brew link -f libiconv
$ sudo gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14

or check what the version is by running ls /usr/local/Cellar/libiconv. Also note that the -- is intentional.

If you are having problems with architectures (32 bit vs 64 bit), then you might want to try adding export ARCHFLAGS="-arch x86_64" to your ~/.bash_profile file.