【发布时间】:2015-11-06 08:29:17
【问题描述】:
我正在尝试使用 BUILDPACK_URL 将 node js 应用程序部署到 heroku。我已经搜索了我的问题的解决方案,但没有得到任何适合我的问题的答案。
这是我遵循的程序:
heroku create myapp
heroku config:add BUILDPACK_URL='https://github.com/stephanmelzer/heroku-buildpack-nodejs-grunt-compass.git'
然后我提交我的更改,然后:
git push heroku master
它在grunt 任务开始之前运行良好。我已经安装了compass gem 来与 grunt 一起工作。
当 heroku 尝试启动 grunt 任务时,出现以下错误:
`remote: -----> Installing Compass
remote: WARNING: You don't have /tmp/build_2f866d4293332f62a9a9aa576a411628/.gem/ruby/2.2.0/bin in your PATH,
remote:gem executables will not run.
`
在那个警告之后,我收到一条消息说指南针安装成功
remote: Building native extensions. This could take a while...
remote: Successfully installed ffi-1.9.10
remote: Successfully installed rb-inotify-0.9.5
remote: Successfully installed rb-fsevent-0.9.5
remote: Successfully installed chunky_png-1.3.4
remote: Successfully installed sass-3.4.16
remote: Successfully installed compass-import-once-1.0.5
remote: Successfully installed compass-core-1.0.3
remote: Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
remote: Successfully installed compass-1.0.3
remote: 8 gems installed
然后在 heroku 尝试运行 `grunt' 之后。此时我收到以下错误:
remote: -----> Running grunt heroku:production task
remote: Running "env:src" (env) task
remote:
remote: Running "clean:dist" (clean) task
remote:
remote: Running "compass:dist" (compass) task
remote: Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass Use --force to continue.
remote:
remote: Aborted due to warnings.
我不知道为什么它没有找到 PATH for compass gem,它已经安装在我的本地机器上。
which compass
result: /home/username/.rvm/gems/ruby-2.2.0-preview1/bin/compass
谁能告诉我如何克服这个问题并正确设置 gem 的 PATH 变量。
非常感谢。
【问题讨论】:
-
试试
heroku config:add BUILDPACK_URL=https://github.com/[account]/heroku-buildpack-multi.git,看看是否可行。 From here. -
我试过了,但没有运气。非常感谢您的回复。
标签: javascript ruby node.js heroku gruntjs