Before start, make sure that:
1. You are using macOS or Ubuntu 14.04(or higher)
- basic system tools like git are installed. If you are using macOS, make sure you have Xcode/ Xcode Tool Chain installed.
Installation guide
Install Ruby and Rails
Check this guide on ruby-china(https://ruby-china.org/wiki/install_ruby_guide)
some advice
use rvm or rbenv for better performance.
use ⌘
gem install rails -v 4.1.4
will install the specific version of rails.
Install Mongodb
Follow this guide on mongodb.org (https://docs.mongodb.com/manual/installation/)
If you are using macOS, try use homebrew for all the installation.
brew install mongodb
Install angularjs
We are using bower for front-end js package management, so you should install nodejs and use npm install bower first.
install node and npm. check documents on https://nodejs.org/en/
Try to use nvm instead of install from the website. Official installer may cause npm not work. (This may be a bug, I have encounter this on macOS and Ubuntu many times). If you installed this official build, and encounter the same problems, JUST USE NVM.
nvm guide:
1. use the script to install nvm. (The script is shown on nvm GitHub project).
2. usenvm install <version>
to install a specific version of node. for example:nvm install 6.10.0
.
3. usenvm alias default <version>
to make this node version as your default version, so you don't need to choose every time you open a new terminal.
4. usenode -v
andnpm -v
to check whether you have these tools installed.
5. now you can usenpm install
⌘ to install node packages.install bower using npm
npm install -g bower
check documents on https://bower.io/#install-bower
SSH key
ssh key is used to communicate with gitlab server, follow these steps:
open your terminal and run ⌘
ssh-keygen -t rsa
just use default options and set no password, and ssh key will be generated.
run ⌘
cat ~/.ssh/id_rsa.pub
, copy the ssh key, and add it to your github account.
Run guide
make sure you have git ruby rails mongodb bower installed first.
git clone
cd to project folder and run ⌘
bundle install
run ⌘
bower install
run ⌘
rails s
- this is for development, if you wanna run rails in production mode, userails s -e production
.-e
is used to environments, default is development.check output.