Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle installing local packages #9

Closed
metalaureate opened this issue Jun 18, 2013 · 7 comments
Closed

How to handle installing local packages #9

metalaureate opened this issue Jun 18, 2013 · 7 comments

Comments

@metalaureate
Copy link

What would be the recommended way of installing local packages? Should I include them in my local files as .gz and add the following to my init.r?

install.packages("localpkgs/sentiment_0.2.tar.gz", repos = NULL, type="source")
install.packages("localpkgs/Rstem_0.4-1.tar.gz", repos = NULL, type="source")

Thank you for this buildpack - it's going to be a godsend.

@virtualstaticvoid
Copy link
Owner

I'll investigate the best option to use.

@metalaureate
Copy link
Author

Wow, thank you!

@virtualstaticvoid
Copy link
Owner

Ok, I've managed to replicate your issue:

Warning: invalid package 'localpkgs/Rstem_0.4-1.tar.gz'
Error: ERROR: no packages specified
Warning message:
In install.packages("localpkgs/Rstem_0.4-1.tar.gz", repos = NULL,  :
  installation of package 'localpkgs/Rstem_0.4-1.tar.gz' had non-zero exit status

I'm working on getting the current directory correct, so that absolute paths aren't necessary.

As a side note; when installing the packages locally, I found that the sentiment package is dependant on the Rstem package, so make sure the Rstem package is installed first.

> install.packages("localpkgs/sentiment_0.2.tar.gz", repos = NULL, type="source")
Warning in install.packages :
  package ‘localpkgs/sentiment_0.2.tar.gz’ is not available (for R version 2.14.1)
Installing package(s) into ‘/home/user/R/Runtime/library’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘tm’, ‘Rstem’ are not available for package ‘sentiment’
* removing ‘/home/user/R/Runtime/library/sentiment’
Warning in install.packages :
  installation of package ‘localpkgs/sentiment_0.2.tar.gz’ had non-zero exit status

@virtualstaticvoid
Copy link
Owner

I've managed to sort out the issue by setting the working directory explicitly before executing init.r during the compile phase.

The changes are on the development branch, so append #development to the buildpack URL when creating your Heroku application:

E.g.

heroku create -s cedar -b https://github.com/virtualstaticvoid/heroku-buildpack-r.git#development

@metalaureate
Copy link
Author

Fantastic thank you

Sent from my phone.

On Jun 20, 2013, at 10:24 AM, Chris Stefano notifications@github.com wrote:

I've managed to sort out the issue by setting the working directory explicitly before executing init.r during the compile phase.

The changes are on the development branch, so append #development to the buildpack URL when creating your Heroku application:

E.g.

heroku create -s cedar -b https://github.com/virtualstaticvoid/heroku-buildpack-r.git#development

Reply to this email directly or view it on GitHub.

@virtualstaticvoid
Copy link
Owner

BTW: I created a sample application for this use-case. See heroku-buildpack-r-local-pkg-example.

@metalaureate
Copy link
Author

Thanks! I'm going to try to combine your build pack into a multipack using https://github.com/ddollar/heroku-buildpack-multi and run Rserv / node (https://github.com/albertosantini/node-rio) front end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants