Development:Setup:OSX: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 57: Line 57:


==Install Bundled Gems==
==Install Bundled Gems==
Set JAVA_HOME for the rjb gem:
Set JAVA_HOME for the rjb gem (set it to a valid location, your path may vary):
<pre style="white-space:normal;">export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/</pre>
<pre style="white-space:normal;">export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/</pre>
<pre style="white-space:normal;">bundle install</pre>
<pre style="white-space:normal;">bundle install</pre>

Revision as of 15:17, 12 March 2017

Prerequisites

  • You must have shell access
  • You must have root access (via sudo), or the required software must already be installed

Install Git

Git for OS X

Get Expertiza

Fork Expertiza to your Github

  • If you don't have a Github account, register one, and remember the password!!
  • go to https://github.com/expertiza/expertiza and click on the "Fork" button on the upper right side.
  • When asked "Where should we fork this repository?" choose your account, which usually looks like this "@YourUsername"
  • Then go to https://github.com/[YourUsername]/expertiza and click on the "Clone or Download" button
  • Copy the url, which usually looks like "https://github.com/[YourUsername]/expertiza.git"
  • Then go to your terminal and go to a folder of your choice where the codes will be downloaded into.
  • To clone the project, type in "git clone https://github.com/[YourUsername]/expertiza.git"
  • when asked for a password, enter your password

Merge your changes to Expertiza

  • When you're done editing the code, commit the code to your local repository by executing this in terminal:
    • git add -A #mark all changed files to be committed to the repository
    • git commit -m "say what you have done to the code" #commit your changes to the local repository
    • git push #sync your changes to the remote repository
  • Do commit as often as needed to store the states of the code. Do commit before you do changes that you're not sure about. It'd allow you to revert back to your previous states if you screw up the code.
  • Do push less often (maybe every 5-10 commits)
  • Before requesting for a merge, please refactor your code and put comments. Bad code won't be merged!
  • After you're done with beautifying your project, go to https://github.com/[YourUsername]/expertiza, and click on "New pull request" on the left side.
  • Your code will be reviewed and merged if the quality is good enough!

[DEPRECATED. DO NOT USE UNLESS ADVISED]

Expertiza Repository URLs
Default [DEPRECATED]
git clone <remote>
git clone git@github.com:expertiza/expertiza.git
Options
git clone -b <branch> <remote>
git clone -b production git@github.com:expertiza/expertiza.git

Install Homebrew

http://mxcl.github.io/homebrew

Install RBENV

$ brew update
$ brew install rbenv
$ brew install ruby-build

Install Ruby v. 2.1.5

https://github.com/sstephenson/ruby-build/wiki#installing-187-on-os-x-108-mountain-lion

Install Native Expertiza Dependencies

Dependencies are for the gems raspell, rjb, nokogiri, and mysql.

brew install aspell gcc47 libxml2 libxslt graphviz openssl

Install Bundled Gems

Set JAVA_HOME for the rjb gem (set it to a valid location, your path may vary):

export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/
bundle install

Set Up the Database

Set the MySql Root Password

This step is not necessary, but it is advised to set a root mysql password.

mysqladmin -u root password

Log in to MySql

mysql -uroot -p

The following commands are executed inside mysql

Create the Expertiza User

create user expertiza@localhost;

Create the Databases

create database pg_development;
create database pg_test;

Grant Privileges to the Expertiza User

grant all on pg_development.* to expertiza@localhost;
grant all on pg_test.* to expertiza@localhost;

Build the Expertiza Database

Notice: You may need to prepend the following commands with bundle exec.

rake db:migrate
rake db:test:prepare

Import Production Data (Optional)

This step requires that you have your ssh private/public key pairs loaded in the production server under the rails user.
How to Add SSH Keys to the Expertiza Production Server
You must run the following command from your local Expertiza project directory.

cap production load_data