问题
I'm writing a node app on heroku, and the app requires a gem, compass to be installed, for node-compass.
However, I can't seem to work out how you install gems in a node application on heroku. I have a Gemfile, which looks like so.
source "https://rubygems.org"
gem 'compass'
Have you managed to do this successfully before?
回答1:
According to an official reply from Heroku for this question:
You would need to use the heroku multi buildpack in order to have both the Ruby buildpack and the Node buildpack: https://github.com/ddollar/heroku-buildpack-multi
回答2:
In addition to a Gemfile, you need a buildpack and a Gemfile.lock. I wrote up how I got this working in this answer to a slightly different question, but I think it should answer this question too.
来源:https://stackoverflow.com/questions/15465342/installing-gems-on-node-heroku-projects