Installing Octopress (and Ruby via RVM) on a Lion box that has Xcode 4.2
In my quest to move away from Wordpress (and PHP/MySQL, which reminds me far too much of 1999 for my comfort), I'm evaluating several static site blog solutions to migrate this blog to and to use for a couple of other blogs that I want to set up for next year. As part of the process, I wanted to give Octopress a shot. Octopress is a static site blogging solution built on mojombo/jekyll – the solution that powers GitHub Pages. The beauty of it is that you can simply deploy your blog to GitHub Pages, and even use a custom domain, simply by pushing to your repository (GitHub will pass your repository through Jekyll automatically–simples!)
The problem is that there are apparently issues with installing the dependencies on a box running Lion with Xcode 4.2. The following solution worked for me. I hacked it together from that StackOverflow thread as well as the Octopress Setup Guide:
- Install RVM:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
- Add RVM to your shell as a function:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile source ~/.bash_profile
- Use RVM to install the latest Ruby:
rvm install 1.9.3 --with-gcc=clang
- …and use it:
rvm use 1.9.3
(This also resulted in the latest ruby gems (1.8.10 at the time of writing) being installed for me - Download Octopress:
git clone git://github.com/imathis/octopress.git octopress
- Change your current working directory to the octopress folder:
cd octopress
- You should get an alert from RVM, asking you if you want to trust the
.rvmrc
file in the folder. Respond with (y)es, and you should get an error:WARN: ruby ruby-1.9.2-p290 is not installed. To install do: 'rvm install ruby-1.9.2-p290'
Resolved this by editing the
.rvmrc
file and changing its contents to readrvm 1.9.3
instead ofrvm 1.9.2
(RVM will ask you to re-confirm that you want to trust the file after you've updated it.) - Check the Ruby version
ruby --version
. You should seeruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
- Install dependencies:
gem install bundler bundle install
- Install the default theme:
rake install
- To test your new blog:
rake preview
then hit it in the browser athttp://localhost:4000
- To learn how to deploy your site, etc., follow the links in the "Next steps" section of The Octopress Setup Guide (by the way, why have people stopped adding anchors or ids to their headings? One small id for you, one big deep link for everyone else.) :)
That's it, that should get you up and running with Octopress (and the latest Ruby–as of this writing, 1.9.3-p0), on a box running OS X Lion and Xcode 4.2.x.
Comments
by Jonathan OverBlog on 2011-11-29 13:47:21
by Dan Avery on 2012-01-03 19:34:18
by bndctc on 2011-12-11 20:49:27
by alfonso on 2012-02-24 23:19:07
by alfonso on 2012-02-25 01:00:28