2016-09-11 51 views
2

我正在關注Jason Swett的「Angular for Rails Developers」一書中的教程。主題在第2章:部署。部署到heroku - 未能檢測到buildpack nodejs(jasonswett)

首先,我這樣做:

$ 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 

這裏是builpacks結果

=== 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' 

我希望得到任何幫助。謝謝。

更新:

我在軌根中運行了git push。這是ls -la的輸出; LS -la客戶端:

$ 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 
+0

兩個問題:1)什麼是文件夾,當你運行'GP的Heroku master'的嗎?它是你的Rails根? (應該是)2)在你的Rails根目錄下,你能分享這個命令的輸出嗎? 'ls -la; ls -la client' –

+0

@JasonSwett更新了我的問題。是的,我在rails根目錄下。 –

+0

如果您嘗試按照這些說明進行操作,該怎麼辦? https://www.angularonrails.com/deploy-rails-application-angular-cli-webpack-front-end/ –

回答

1

這裏試試這個

gp --force heroku master 

希望GP就是git push

+0

推動它成功,該建築失敗。 –

+0

遙控器:!推送失敗?檢查你的日誌 – Arvind

+0

啊對不起。我嘗試過使用 - 但仍然沒有運氣。 –

相關問題