-
Notifications
You must be signed in to change notification settings - Fork 2
Setting up your development environment
Setting-up much of this requires many dependencies and a lot of screwing around with MySQL. We recommend you use Vagrant to set it all up. It's more clean (all dependencies go in a VM, not your local machine), and enforces consistency across all development environments (free reproducability).
Make sure you have Ruby 2, Rails 4, node.js (or some JS runtime), and MySQL installed. If not, follow one of the below!
- Follow this, skipping SQLite and stopping once you've installed Rails.
- Install MySQL.
- Install node.js:
brew install node
Use Vagrant.
If you're using Ubuntu or a Debian-based system, you can more or less run the
bootstrap.sh
file that sets up Vagrant. Otherwise, the commands should be
very similar. Follow along, and you should generally get it right. Do note that
the Oracle MySQL setup may be different (e.g. where to put certain
configuration files, etc.), so you may want to look up setup for your exact
distribution.
What is Vagrant? It's a headless (no UI), virtual development environment. You can run Vagrant in VirtualBox on pretty much any machine, so this is a good option if you want to skip the OS-specific stuff.
- Install Vagrant and VirtualBox.
git clone [email protected]:wrekatlanta/wrektranet.git
- Grab the Oracle InstantClient files from Oracle for Linux, and move them into the top-level Wrektranet directory
- Run
vagrant up
to set up the virtual machine. - Run
vagrant ssh
to ssh into your virtual machine. -
cd /vagrant/wrektranet
to get to the project directory. - Set up the database by following the instructions under the Database section
- Run
rails s
and see if it all starts up
-
bundle
to install all the dependencies for this project. - If you don't plan on using any of the playlist/music data (from the Oracle database) locally, you can run:
bundle install --without=oracle
- If you need to install Oracle drivers, follow this guide and run
bundle
normally.
cp config/database.example.yml config/database.yml
- Set a
username
andpassword
in yourdatabase.yml
if necessary. cp config/application.example.yml config/application.yml
The Rails Vagrant box might have a username and password. Try looking it up or looking through its source. Someone should udpate this if they figure it out.
Now you can run the commands to set the database up (creating it, loading the database schema, setting up the separate testing database, creating seed data):
bundle exec rake db:create:all
bundle exec rake db:schema:load
bundle exec rake db:test:prepare
bundle exec rake db:seed
- Start the app with
rails server
orrails s
- Go to
localhost:3000
to see the app. You can login with[email protected]
andpassword
, which was specified indb/seeds.rb
. - Optionally, you can run the app using
guard
to watch for updates to tests and changes that require restarting the server.
- Need to nuke the database?
bundle exec rake db:drop:all
- Need to run database migrations?
bundle exec rake db:migrate
- Need to install gems?
bundle install
- Here's a cheat sheet.