Using Rmd Markdown in Pelican

[This article was first published on Reimagined Invention, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

My notebook is dead until I buy a new battery. Now I’m using a lent MacBook Pro for urgent work and I had to install R, RStudio and Stata. After doing the basics I’ve realised a lot of things weren’t working as they were on my laptop.

This blog is based on Pelican. Among other R’s useful packages, I use XLConnect, knitr and rmarkdown that were easy to install without problems and only required Java updates and installing some dependencies from R prompt. The problem came with many errors when I tried to finish a blog entry after writing pelican content in terminal:

Starting point

These readings were really useful and after I did follow all the steps here I was still obtaining errors. It is very important to follow these steps before reading the rest of this entry.

Setting up everything

The above pages are really clear but I needed to work out a little bit more to obtain an error-free result.

First error

ValueError: unknown locale: UTF-8

To solve this part I did follow stackoverflow, but I had to create my own solution which was adding two lines to my .bash_profile file:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Second error

Then I tried to finish a blog entry and the results were lots of these after writing pelican content in terminal:

ERROR: Could not process ./file.Rmd
  | TypeError: (u'Pelican does not know how to parse %s', u'/Users/pacha/pachamaltese.github.io/blog/content/file.Rmd')

I had to install stock Python (not OSX pre-installed Python) using homebrew as it is stated in stackoverflow

After installing homebrew I did run these lines in terminal:

sudo -H pip uninstall pelican
brew install python
which python # should show /usr/local/bin/python
python -V # Python 2.7.11 in my case
pip install pelican

Then I did restart my computer and Pelican worked fine.

To leave a comment for the author, please follow the link and comment on their blog: Reimagined Invention.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)