-
Notifications
You must be signed in to change notification settings - Fork 264
Setting up a development environment
- Install Homebrew
- Install Ruby 2.1.3 (we recommend using RVM)
- Install the following packages from homebrew:
curl
,v8
,redis
,imagemagick
, andnode
- Install Postgres.app
- Jump to "General Instructions"
-
Set up the PGDG apt repository using their instructions
-
Add the Postgresql package repository:
$ echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee -a /etc/apt/sources.list.d/pgdg.list $ sudo apt-get update
-
Install the dependencies:
$ sudo apt-get install curl build-essential git libcurl4-openssl-dev libreadline-dev \ libssl-dev libxml2-dev libxslt1-dev zlib1g-dev libpq-dev libpq5 \ python-psycopg2 pgdg-keyring postgresql postgresql-contrib
-
Install RVM:
curl -L https://get.rvm.io | bash -s stable --ruby=2.1.3
-
Create a new database user for your user with:
$ echo 'CREATE USER username' | psql -U postgres
-
Jump to "General Instructions"
- Make sure that you have VT-x or AMD-v enabled in your BIOS.
- Download a copy of Ubuntu
- Download and install VirtualBox
- Open VirtualBox and create a new Virtual Machine.
- You can choose whatever name you want but make sure to set the
type
toother
and theversion
toOther/Unknown (64bit)
. - All other settings don't need to be changed, you can however adjust the RAM and disk size for your need.
- Start your new VM, select the Ubuntu ISO you previously downloaded, and run through the setup.
- Open the VM's network settings (
Machine > Settings > Network
) and change the type of the adapter tobridge
. -
(*1) Select
Device > Insert medium with guest extension
and run through the setup.
- If this isn't working, navigate to
/media/VBOXADDI...
in a terminal (just hit tab to autocomplete the version number) - Install Guest module via
sh VBoxLinuxAdditions.run
- Select
Edit > Shared folders
in the VirtualBox Overview and click the + icon to add a new shared folder - Mount your shared folder in Linux by running the following in a terminal:
sudo mount -t vboxsf name-of-the-folder path-to-folder-on-vm
- Jump to "Linux Instructions" and come back when you're done with those and the "General Instructions"
- Add your VM to your hosts file so you can access it at
hummingbird.dev
-
In Linux, type
ifconfig
and copy the ip from your ethernet interface (usually namedeth0
) -
In Windows, open
%systemroot%\system32\drivers\etc
and edit the filehosts
-
Add the ip you copied to the bottom of the file like:
192.168.1.38 hummingbird.dev
-
Save the file and check if
hummingbird.dev:3000
works in your browser
(*1) The following three steps describe a setup using the Virtual Box shared folders. However, the performance of shared folders is horrible. (Rendering the page can take up to one minute!) I guess they screwed up the filesystem handling since it worked all fine in earlier versions but for now, I'd suggest using a FTP based solution. Installing and configuring vsftpd and setting up WinSCP with Directory Sincing on the main machine works fine, although it's a pretty laborious workaround.
(*) If you're using a windows machine, pay attention to line endings. They can be really annoying since they call a lot of errors that seems to be random at first. Also, you might want to use git config core.autocrlf true
to ignore CR+LF diffs in GitHub4Windows if you decide to go with that instead of using a git shell.
git clone https://github.com/hummingbird-me/hummingbird.git
- Install
ember-cli
andbower
from NPM withnpm install -g ember-cli bower
- Run
bundle install
in the project root - Run
bundle exec rake db:create db:structure:load db:seed
in the project root - Download the database dump and load it in by running
psql -d hummingbird_development < dump.sql
— if there's errors, ask in the Slack chat, we may need to update it. -
cd frontend
and runnpm install
andbower install
(npm especially can take a while to run — I suggest grabbing a snack while it runs) - Start the server with
bundle exec foreman start
- Open
http://localhost:3000/
in your browser (it may show nothing, mash reload if that happens)
- If
redis
outputs an error while starting the bundle, navigate to/var/log/redis
and check the log file viatail r...
(autocomplete). It contains further instructions on how to solve the issue - If
unicorn
failed startingpostgresql
with the errorno password supplied
, edit the/etc/postgresql/9.2/main/pg_hba.conf
and replace thepeer
/md5
in every uncommented line withtrust
, then reload the config by executingselect pg_reload_conf();
from the database prompt - If the page itself displays database errors, check your user permissions or just
ALTER USER yourname WITH SUPERUSER
to bypass security - If something complains that the wrong Ruby version is being used, try
rvm use 2.1.3
. If it's not working, uservm install 2.1.3
to install the ruby andrvm use 2.1.3
to start it. If the ruby is not available for install, follow this guide
General
› Contributing
› License
Local Setup
› Docker
› Binstubs
› Filling the Database
API Usage
› JSON:API (on Apiary.io)
› JSON:API (WIP rewrite of docs)
› GraphQL (Pre-Production)