-
Notifications
You must be signed in to change notification settings - Fork 25
Install
This article assumes you are using OSX, that you've seen the command line before and that you have a Rails app already.
If you're new to the command line, consult the Terminal.app guide.
If you need to make a new Rails application, consult the Rails app guide.
This article assumes your application is at ~/workspace/client-app
. Substitute your actual application accordingly.
A good text editor is all you need to navigate a basic Rails app. Sublime Text happens to be the finest text editor currently on the market.
We need to add the Style Guide to our list of dependencies. Bundler keeps that information in a file called Gemfile
. First, we need to open Sublime Text.
Next, open the ~/workspace/client-app
directory.
Then, open Gemfile
.
Let's modify Gemfile
to say that we depend on Style Guide by adding the line gem "style-guide"
.
We now need to get Bundler to install all of the dependencies for Style Guide. We can do this on the command line. First, open a Terminal window and go into the ~/workspace/client-app
directory.
Next, we need to pull all of our dependencies in by running bundle install
.
You should see the style-guide
gem show up in the installation text.
Style Guide includes a convenient Rails-only installation mechanism: the install generator. We can do all the complicated setup in one command: rails g style_guide:install
.
We're ready to run Rails again with rails server
.
You can visit Style Guide at http://localhost:3000/style-guide.
A major part of using Style Guide is Guard, which watches your Rails app for changes. Let's open another Terminal tab using Command
+T
and go into the ~/workspace/client-app
directory.
When Guard runs, it wants to know all about where our dependencies are located. We can make sure this happens by running bundle exec guard
.