TheDesignExchange:master build status:
new devs read this!!!!! See our wiki to learn about our workflow
A few manual steps are required. See troublshooting section of readme is you run into issues.
Install postgres.
Mac: brew install postgresql
Ubuntu: sudo apt-get install postgresql
Install rvm, then follow instructions to install correct Ruby version.
As of Aug 2015, this would be: rvm install ruby-2.1.3
(If you have a nonstandard security setup, install rvm without autolibs.)
cd
into the repo and then cd app
to get to the root of the project directory
Bundler. gem install bundler
, then bundle install
Ubuntu: You might have to sudo apt-get install openjdk-6-jdk
for Sunspot.
That's it! Read the next section to see how to start up the server. The recommended usad is the current usage listed below the legacy.
(optional 6th step based on legacy code... not sure if it is necessary since we believe it is executed the first time you run make rails
)
bundle exec rake db:seed
to seed your database with starter data. The Makefile
helps simplify starting and stopping the dev server.
make [rails-]fg # start rails in the foreground normally
make halt # shut down rails and its dependencies
Rails can also be run in the background using screen(1)
as follows:
make [up] # start rails (in the background) and its dependencies
make [rails-]restart # restart rails (in the background)
make [rails-]attach # start rails in the foreground in a screen(1) session
# When developing
make rails # starts rails, pg, and solr, and seeds pg
# IMPORTANT! When finished developing, do this
make halt # shuts everything down and frees the port
rake assets:precompile
We use pry and
pry-byebug for debugging ruby
code. See their respective github repositories for further documentation. In
short, you need to have a visible rails server (run make attach
in a console)
and add a line that reads binding.pry
in the file you want to debug, at the
line where you want the debugger to begin.
In general, we should eventually update ruby and all gems to the most recent version. This will help with old dependencies and any possible security issues.
If you run into problems with nokogiri, it may have to do with your ruby version. Make sure you're using ruby version 2.1.3 since we have yet to update. If this does not resolve the problem, trying re-cloning the repo and make sure you set up the environment with rvm ruby version 2.1.3