#NGO FRONT APP + API
- Ruby Version
- Rails Version
- Install System Dependencies
- Install the App
- Assets
- Running Tests
- Deploying
Ruby version is specified in both the Gemfile
and .ruby-version
. As of this writing, the Ruby version used is 2.3.1.
Rails version is specified in the Gemfile
. As of this writing, the Rails version used is 4.2.7.1
Ensure you have Homebrew installed on your machine. We'll use this to install further dependencies.
brew install postgresql
brew install redis
brew install rbenv
rbenv init
It is recommended that you double-check the installation instructions for installing rbenv with Homebrew. There is a git alternative to installing rbenv as well.
It is recommended that you use NVM to install and manage your Node and corresponding npm versions.
brew install nvm
The node version is documented in .nvmrc
. As of this writing, the Node version has been set to 0.10.29.
To get started, clone this repo:
git clone git@github.com:InterActionNGO/ngoaidmap.git
Install Ruby 2.3.1
with rbenv:
rbenv install 2.3.1
Install Bundler for gem dependencies:
gem install bundler
Then run install to fetch the dependencies:
bundle install
Start PostgreSQL:
brew services start postgresql
Later, you may need to restart or stop PostgreSQL:
#Restart PostgreSQL
brew services restart postgresql
#Stop PostgresQL
brew services stop postgresql
Start redis:
brew services start redis
Later, you may need to restart or stop redis:
#Restart Redis
brew services restart redis
#Stop Redis
brew services stop redis
Some application configuration should not be checked into source control. You need to create copies to run the app locally.
For the database:
cp config/database.yml.sample config/database.yml
After copying the file, leave database.yml
as-is and don't bother setting up a local database. We'll use rake
to do that automatically soon.
For your environment:
cp .env.sample .env
Fill in this file as necessary.
We'll use rake
to setup the database. This dependency should have been installed when you ran bundle install
earlier on.
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
We'll use NPM to install Bower and other npm dependencies. All dependency versions are locked to one version and recorded in package.json
.
# If using nvm, npm commands are not available
# until you install nvm
nvm install
npm install
NPM should have installed everything we need (including Bower). Now that Bower is installed, use it to install further vendor files:
npm run bower install
These vendor files will install at the directory /public/app/vendor
.
At this point, the application should be ready to run locally. Start the server:
bundle exec rails s
Visit http://localhost:3000 in the browser. 🚀
If you ever need to access the Rails console while working, start that with:
bundle exec rails c
Work with assets in the /app/assets
directory. The Rails pipeline will compile the assets as you work in development mode.
TBD
TBD