This tutorial assumes you have some basic understanding of using the Terminal and Git/GitHub. You don't need to be able to hack the Pentagon, but you should know what cd
and ls
do, how to make a branch, and how to submit a pull request on GitHub.
If you don't, check out Codecademy's Command Line course and GitHub's Git tutorial before getting started.
- Install the Xcode command-line tools with
xcode-select –install
. This'll be necessary to install Homebrew. - Install Homebrew with the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
. - Install RVM.
- Use RVM to install Ruby 2.2.4 (
rvm install ruby-2.2.4
) and then switch to that version of Ruby withrvm use ruby-2.2.4 --default
. - Install Git with
brew install git
, then either use Git from the terminal or the GitHub Desktop app to pull down the Fiction-Dock repository. - Install PostgreSQL 9.4 with
brew install postgresql
. We also recommend using Postgres.app on OS X to get the Postgres server running after the initial setup. - Install Bundler with
gem install bundler
. - In the Fiction-Dock directory (wherever you installed the Git repository), run
bundle install
to install all the relevant gems you'll need for developing Fiction-Dock. This might take a bit of time, be patient! - Run
rake db:setup
to set up the Postgres development server. - If everything has gone right so far, you'll be able to start up a Rails server with
rails s
! You can navigate to the URL printed in the Terminal (by default, http://localhost:3000) in your browser to test your local version of Fiction-Dock. - Get working!
You can update packages installed with Homebrew at any time with brew update
and brew upgrade
. You'll likely want to do this once a week, just in case there are security issues in anything you've installed. We recommend using Homebrew as much as possible to install development dependencies, as it makes uninstalling and updating things much easier!
Note: Replace apt-get install
with your distro's equivalent package manager, this uses apt-get
for simplicity's sake.
- Install RVM.
- Use RVM to install Ruby 2.2.4 (
rvm install ruby-2.2.4
) and then switch to that version of Ruby withrvm use ruby-2.2.4 --default
. - Install Git if you need to, then use git from the terminal to pull down the Fiction-Dock repository.
- Install PostgreSQL 9.4 with
apt-get install postgresql
. - Install Bundler with
gem install bundler
. - In the Fiction-Dock directory (wherever you installed the Git repository), run
bundle install
to install all the relevant gems you'll need for developing Fiction-Dock. This might take a bit of time, be patient! - Run
rake db:setup
to set up the Postgres development server. - If everything has gone right so far, you'll be able to start up a Rails server with
rails s
! You can navigate to the URL printed in the Terminal (by default, http://localhost:3000) in your browser to test your local version of Fiction-Dock. - Get working!
- Navigate to your local copy of Fiction-Dock in the Terminal.
rails c
u = User.where(name: "YOUR NAME").first
u.level = :admin
u.save!
quit
Icon font auto-generation technique courtesy of Scott Nelson's post here.
- Assuming you have Homebrew installed on OS X, run
brew install fontforge ttfautohint
from the terminal.
- If you want to install the prerequisites to FontCustom using other means, you can see the installation instructions in the FontCustom README.
- Add icons as
.svg
files toapp/assets/icons
. - From the terminal, in the base Fiction-Dock directory, run
rake icons:compile
. - The new icon font should be generated and immediately useable, you can add the new icon to the site by using the auto-generated CSS classes. For example, if we take an SVG named
heart.svg
, the css class will beicon-heart
.
-
These instructions are for OS X, Linux users should be able to do this as well with some messing about, Windows users... sorry.
-
Be aware that any icons you add to this repository in the
app/assets/icons
folder can and will subsequently be included in our icon font, which is licensed under the SIL Open Font License. As such, you're giving up certain protections of icons you've created. If you didn't create the icons, you shouldn't try to include them in this project.
Fiction Dock is released under the GNU Affero General Public License. All branding material is copyright 2015 Noided Media LLC. All rights reserved.