Working with ruby on OSX

01 Mar 2015

I’ve been trying to get my head around how to be productive on OSX. I often come along script commands to facilitate the development process and take alot of the menial tasks off to a short script in a command line. However I’m often stumbling around in the dark. An example of this is using jekyll to compile my blog.

Every time I come to write a blog post (once every 3 months going by history) I have to re-rememeber how to compile. Inevitably I think “How do I compile the site?” and type “Jeckyll” into google (Yes my spelling is atrocious). Then I realise it’s a simple case of putting the directory into the command window and running the following

$ jekyll

Which of course tells me

-bash: jekyll: command not found

Sigh - Did I uninstall it? Let’s install again then.

$ gem install jekyll

Tells me

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the 
    /Users/.../.rvm/gems/ruby-2.0.0-p247/bin directory.

Oh yes - I remeber I have a weird ruby setup - it’s installed using sudo - but I have another one in there…

$ rvm use 2.1.2

Using /Users/digiguru/.rvm/gems/ruby-2.1.2

$ gem install jekyll

This then fires off the install again. Phew.

NB - If you don’t have rvm installed than I suggest the RVM site.

The jekyll command is now recognised - great time to build the site.

$ jekyll build
Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'.
Please update your config file accordingly. 
The allowed values are 'rouge', 'pygments' or null.

Oh yes - I forgot. Every time you install software a fresh you run the risk of important pieces being depricated. Let’s try again after renaming the property in the _config.yml file.


Probably best to test it…

jekyll serve

And now I can publish my next blog post the post you’ve just read.