部署到heroku - 无法检测到buildpack nodejs(jasonswett)

时间:2016-09-11 14:22:53

标签: ruby-on-rails angularjs node.js heroku

我正在遵循Jason Swett撰写的“Angular for Rails Developers”一书中的教程。主题在第2章:部署。

首先我这样做了:

$ rm -rf public
$ ln -s client/dist public

然后在heroku中创建应用程序后,我添加了buildpacks

$ heroku buildpacks:add https://github.com/jasonswett/heroku-buildpack-nodejs
$ heroku buildpacks:add heroku/ruby

以下是构建包的结果

=== author-wizard Buildpack URLs
1. https://github.com/jasonswett/heroku-buildpack-nodejs
2. heroku/ruby

这是package.json文件

{
      "name": "author-wizard",
      "version": "0.0.0",
      "license": "MIT",
      "angular-cli": {},
      "scripts": {
        "start": "ng server",
        "postinstall": "typings install && ng build",
        "lint": "tslint \"src/**/*.ts\"",
        "format": "clang-format -i -style=file --glob=src/**/*.ts",
        "pree2e": "webdriver-manager update",
        "e2e": "protractor"
      },
      "private": true,
      "dependencies": {
        "@angular/common": "2.0.0-rc.1",
        "@angular/compiler": "2.0.0-rc.1",
        "@angular/core": "2.0.0-rc.1",
        "@angular/platform-browser": "2.0.0-rc.1",
        "@angular/platform-browser-dynamic": "2.0.0-rc.1",
        "@angular/router": "2.0.0-rc.1",
        "es6-shim": "^0.35.0",
        "reflect-metadata": "0.1.3",
        "rxjs": "5.0.0-beta.6",
        "systemjs": "0.19.26",
        "zone.js": "^0.6.12",
        "angular-cli": "0.0.*",
        "clang-format": "^1.0.35",
        "codelyzer": "0.0.14",
        "ember-cli-inject-live-reload": "^1.4.0",
        "jasmine-core": "^2.4.1",
        "jasmine-spec-reporter": "^2.4.0",
        "karma": "^0.13.15",
        "karma-chrome-launcher": "^0.2.3",
        "karma-jasmine": "^0.3.8",
        "protractor": "^3.3.0",
        "ts-node": "^0.5.5",
        "tslint": "^3.6.0",
        "typescript": "^1.8.10",
        "typings": "^0.8.1"
      },
      "devDependencies": {

      }
    }

当我推到heroku时:

$ gp heroku master
Counting objects: 54, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (54/54), 11.31 KiB | 0 bytes/s, done.
Total 54 (delta 17), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://github.com/jasonswett/heroku-buildpack-nodejs
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to author-wizard.
remote:
To https://git.heroku.com/author-wizard.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/author-wizard.git'

我将不胜感激任何帮助。谢谢。

更新

我在rails根目录中运行了git push。这是ls -la的输出; ls -la client:

$ ls -la; ls -la client
total 80
drwxr-xr-x  22 praburangki  staff   748 Sep 11 21:34 .
drwxr-xr-x  36 praburangki  staff  1224 Sep 11 20:27 ..
-rw-r--r--   1 praburangki  staff    43 Sep 11 21:39 .byebug_history
drwxr-xr-x  14 praburangki  staff   476 Sep 12 07:34 .git
-rw-r--r--   1 praburangki  staff   468 Sep 11 19:35 .gitignore
-rw-r--r--   1 praburangki  staff    30 Sep 11 21:09 .rspec
-rw-r--r--   1 praburangki  staff  1393 Sep 11 21:27 Gemfile
-rw-r--r--   1 praburangki  staff  4428 Sep 11 21:28 Gemfile.lock
-rw-r--r--   1 praburangki  staff   374 Sep 11 19:35 README.md
-rw-r--r--   1 praburangki  staff   227 Sep 11 19:35 Rakefile
drwxr-xr-x   9 praburangki  staff   306 Sep 11 21:13 app
drwxr-xr-x   8 praburangki  staff   272 Sep 11 19:36 bin
drwxr-xr-x  19 praburangki  staff   646 Sep 11 20:32 client
drwxr-xr-x  14 praburangki  staff   476 Sep 11 19:35 config
-rw-r--r--   1 praburangki  staff   130 Sep 11 19:35 config.ru
drwxr-xr-x   5 praburangki  staff   170 Sep 11 21:15 db
drwxr-xr-x   3 praburangki  staff   102 Sep 11 19:35 lib
drwxr-xr-x   5 praburangki  staff   170 Sep 11 21:16 log
lrwxr-xr-x   1 praburangki  staff    11 Sep 11 20:33 public -> client/dist
drwxr-xr-x   8 praburangki  staff   272 Sep 11 21:24 spec
drwxr-xr-x   7 praburangki  staff   238 Sep 11 19:40 tmp
drwxr-xr-x   2 praburangki  staff    68 Sep 11 19:35 vendor
total 64
drwxr-xr-x  19 praburangki  staff   646 Sep 11 20:32 .
drwxr-xr-x  22 praburangki  staff   748 Sep 11 21:34 ..
-rw-r--r--   1 praburangki  staff    73 Sep 11 20:07 .clang-format
-rw-r--r--   1 praburangki  staff   234 Sep 11 20:07 .editorconfig
drwxr-xr-x  12 praburangki  staff   408 Sep 11 22:20 .git
-rw-r--r--   1 praburangki  staff   335 Sep 11 20:07 .gitignore
-rw-r--r--   1 praburangki  staff   426 Sep 11 20:07 angular-cli-build.js
-rw-r--r--   1 praburangki  staff   415 Sep 11 20:07 angular-cli.json
drwxr-xr-x   8 praburangki  staff   272 Sep 11 20:07 config
drwxr-xr-x  12 praburangki  staff   408 Sep 11 20:28 dist
drwxr-xr-x   6 praburangki  staff   204 Sep 11 20:07 e2e
drwxr-xr-x  23 praburangki  staff   782 Sep 11 20:08 node_modules
-rw-r--r--   1 praburangki  staff  1251 Sep 11 22:16 package.json
drwxr-xr-x   3 praburangki  staff   102 Sep 11 20:32 public
drwxr-xr-x   9 praburangki  staff   306 Sep 11 20:07 src
drwxr-xr-x   3 praburangki  staff   102 Sep 11 20:32 tmp
-rw-r--r--   1 praburangki  staff  1685 Sep 11 20:07 tslint.json
drwxr-xr-x   6 praburangki  staff   204 Sep 11 20:09 typings
-rw-r--r--   1 praburangki  staff   352 Sep 11 20:07 typings.json

1 个答案:

答案 0 :(得分:1)

试试这个

gp --force heroku master

希望这里gp意味着git push