- JDBC Oracle driver
- JRuby 1.7.0
- Rails 3.2.8
- Rvm - Ruby version managers
- Install postgres
brew update brew install postgresql initdb /usr/local/var/postgres
- Start postgres, add the user and create the necessary databases
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start psql postgres create database calcentral_development; create user calcentral_development with password 'secret'; grant all privileges on database calcentral_development to calcentral_development; create database calcentral; create user calcentral with password 'secret'; grant all privileges on database calcentral to calcentral; create database calcentral_test; create user calcentral_test with password 'secret'; grant all privileges on database calcentral_test to calcentral_test;
- Fork this repository, then:
git clone firstname.lastname@example.org:[your_github_acct]/calcentral.git
- Go inside the
cd calcentral # Answer "yes" if it asks you to trust a new .rvmrc file.
- Install jruby
rvm get head rvm install jruby-1.7.0 cd .. cd calcentral # Answer "yes" again if it asks you to trust a new .rvmrc file.
- (Optional for development) Make JRuby faster & enable C extensions by running this or put in your .bashrc:
export JRUBY_OPTS="-Xcext.enabled=true -J-d32 -J-client -X-C"
WARNING: Do not switch between 32-bit and 64-bit JRuby after your gemset has been initialized (your bundle library will have serious issues). If you do need to change settings, make sure to reinitialize your gemset:
rvm gemset delete calcentral
- (set your JRUBY_OPTS)
- Download the appropriate gems with Bundler
- Copy and update the settings
mkdir ~/.calcentral_config cp config/settings.yml ~/.calcentral_config/settings.local.yml cp config/settings/testext.yml ~/.calcentral_config/testext.local.yml cp config/settings/development.yml ~/.calcentral_config/development.local.yml cp config/settings/production.yml ~/.calcentral_config/production.local.yml
and update the settings in the
Settings live outside of the project dir to prevent accidental commits to the repo.
You can also create Ruby configuration files like "settings.local.rb" and "development.local.rb" to amend the standard
Install JDBC driver (for Oracle connection) You may already have an Oracle driver from MyBerkeley-OAE development, in which case you just need to copy it to your local JRuby installation:
cp ~/.m2/repository/com/oracle/ojdbc6/188.8.131.52/ojdbc6-184.108.40.206.jar ~/.rvm/rubies/jruby-1.7.0/lib/
- Otherwise, download ojdbc6.jar
- Copy ojdbc6.jar to your local JRuby installation; e.g.
Initialize PostgreSQL database tables
- Start the server
- Access your development server at localhost:3000. Do not use 127.0.0.1:3000, as you will not be able to grant access to bApps.
See code changes happening live in the browser and look at the testing
foreman start in the terminal, it will:
- Start the rails server
- Expose the jasmine tests at http://localhost:8888
- Start Guard for livereload.
- Precompile the assets: (more info)
bundle exec rake assets:precompile
- Serve static assets through rails
config.serve_static_assets = true
- Start the server in production mode
rails s -e production
- After testing, remove the static assets and generated pages
bundle exec rake assets:clean rm public/index.html # remove other pages ...
Make sure you are on the Berkeley network or connected through preconfigured VPN for the Oracle connection. If you use VPN, use group #1 (1-Campus_VPN)
- On Mac OS X, to get RubyMine to pick up the necessary environment variables, open a new shell, set the environment variables, and:
- If you want to explore the Oracle database on Mac OS X, use SQL Developer
- Use an editor that supports .editorconfig. Feel free to have a look at the editor plug-ins
<ng:view> <span ng-bind="name"></span>
<div data-ng-view></div> <span data-ng-bind="name"></span>
Make sure your test.local.yml file has real connections to real external services that are fakeable (Canvas, Google, etc). Now do:
rake spec freshen_vcr=true git add fixtures/fakeable_proxy_data git commit -a -m "Helpful commit message"
To view other rake task for the project:
rake spec:xml- Runs rake spec, but pipes the output to xml using the rspec_junit_formatter gem, for JUnit compatible test result reports