When attempting to clone my Octopress repository on a new machine, I had the
same Updates were rejected
problem that is described on this page.
Based on the information provided on that page, combined with a few other
commands required for Ubuntu machines, this post provides instructions for
cloning an Octopress repository.
(This works on Ubuntu 13.10 and probably other variants.)
-
Make sure ruby1.9.1-dev and gem are installd:
sudo apt-get install ruby1.9.1-dev gem gem install bundler rbenv rehash
-
Get the source and initialize empty _deploy directory:
git clone git@github.com:williamdemeo/williamdemeo.github.io.git cd williamdemeo.github.io/ git checkout source mkdir _deploy cd _deploy git init git remote add -t master -f origin git@github.com:williamdemeo/williamdemeo.github.io.git cd ..
-
Use bundler to check that all the dependencies in GemFile are met:
bundle install
-
Generate the pages and deploy:
rake generate rake deploy
Troubleshooting.
If rake generate
produces “invalid byte sequence in US-ASCII” then try the following:
# from the command line
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
bundle
Workflow
-
Make some changes, e.g., create a new post:
rake new_post["title"]
-
Posts live in
source/_posts
. Edit one and push the changes to source branch either directly with Magit or withgit add . git commit -am "explanation of changes" git push origin source
-
Now preview the changes:
rake preview
and loadhttp://localhost:4000
in browser. -
When satisfied,
rake deploy
.
Other Resources
- Get RedCloth installed properly on Ubuntu
- Setup Octopress, pick a theme, maintain with rake
- Setup an existing Octopress repo
- Maintain Octopress repo on multiple machines
- Get MathJax working (one way)
- Get MathJax working (another)
- Select a nice theme
- Troubleshoot UTF-8 locale
- Changing fonts and colors
- Carl Boettiger has an awesome open notebook.