How to install and load Ruby packages in R

I'm trying to use Ruby's google-finance API (https://github.com/dblock/google-finance-ruby-client) within an RMarkdown file. However, I keep getting this error when I try to run the ruby code chunk in my Rmd file

C:/Users/user/AppData/Local/Temp/RtmpyAzBuv/chunk-code-16d06afb7ac2.txt:4:in `<main>': undefined local variable or method `google' for main:Object (NameError)

Does anyone know how to successfully load a Ruby package within an RMarkdown file in order to run Ruby commands? Here is my Rmd file

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


```{ruby}
# Install API
gem install google-finance-ruby-client

# Pull Microsoft stock price

prices = GoogleFinance::History.get('MSFT', start_date: Date.parse('2016-01-03'), end_date: Date.parse('2016-01-10'))

```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.