1

我将 sass 添加到了一个新的 phoenix 项目中。

像这样:

  1. 添加"sass-brunch": ">= 1.9"到 package.json
  2. 将 app.css 重命名为 app.sass
    • 删除 {、} 和 ; 来自 sass 文件,并检查所有内容是否有效 sass

它可以在本地工作,但是当我将项目推送到 dokku 安装时,它会卡在

You need to have Sass on your system
Execute `gem install sass`

这对我来说很奇怪 - 我认为它会在运行 npm-install 时安装,因为我确实在 package.json 中添加了它

然后它卡在

10 Jan 15:02:11 - info: compiling

我当前的 package.json

{
  "repository": {
  },
  "dependencies": {
    "babel-brunch": "^6.0.0",
    "brunch": "^2.0.0",
    "clean-css-brunch": ">= 1.0 < 1.8",
    "css-brunch": ">= 1.0 < 1.8",
    "javascript-brunch": ">= 1.0 < 1.8",
    "uglify-js-brunch": ">= 1.0 < 1.8",
    "sass-brunch": ">= 1.9"
  },
  "scripts": {
    "start": "node server.js"
  }
}

有什么线索吗?我的下一步是我会尝试看看我是否可以登录到那个特定的应用程序并手动安装那个 gem,但是一定有更好的方法吗?

现在,当我再次尝试推送应用程序时,它就卡在了那个位置

remote: phoenix is currently being deployed or locked. Waiting...:\

更新
“它似乎通过创建一个空的隐藏文件来锁定Dokku :/home/dokku/app/.build.lock我只是删除了这个文件,我能够再次部署。”
所以 ssh 进入 dokku@your-page 或 root@your -page,无论你有什么设置 -cd /home/dokku/app-name/然后(可选:你可以先运行ls -la看看 .build.lock 在那里)运行rm .build.lock 现在你应该能够再次推送。)

更新
手动安装 sass gem 没有帮助。


更新

查看了 dokku list的已知问题。我发现没有提到 sass、css 或资产。


unname -a Linux maleficent 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

免费-m

             total       used       free     shared    buffers     cached
Mem:           994        885        108         21         89        111
-/+ buffers/cache:        684        309
Swap:         2047        461       1586

码头工人版本

Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64

码头工人 -D 信息

Containers: 23
Images: 131
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 177
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-71-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 1
Total Memory: 994 MiB
Name: maleficent
ID: JD4N:6BHQ:NUG6:BLP2:VTW5:LRIH:UY35:6GEL:OXQH:2AEK:O6OO:A3SM
WARNING: No swap limit support

docker run --rm -ti gliderlabs/herokuish:最新的herokuish版本

herokuish: 0.3.5
buildpacks:
  heroku-buildpack-clojure   v70
  heroku-buildpack-go        v18
  heroku-buildpack-gradle    v12
  heroku-buildpack-grails    v19
  heroku-buildpack-java      v40
  heroku-buildpack-multi     26fa21a
  heroku-buildpack-nodejs    v86
  heroku-buildpack-php       v80
  heroku-buildpack-play      v24
  heroku-buildpack-python    v70
  heroku-buildpack-ruby      v140
  heroku-buildpack-scala     v63
  https://github.com/dokku/buildpack-nginx v5

独孤版

0.4.6

独库插件

  00_dokku-standard    0.4.0 enabled    dokku core standard plugin
  20_events            0.4.0 enabled    dokku core events logging plugin
  apps                 0.4.0 enabled    dokku core apps plugin
  backup               0.4.0 enabled    dokku core backup plugin
  build-env            0.4.0 enabled    dokku core build-env plugin
  certs                0.4.0 enabled    dokku core certificate management plugin
  checks               0.4.0 enabled    dokku core checks plugin
  common               0.4.0 enabled    dokku core common plugin
  config               0.4.0 enabled    dokku core config plugin
  docker-options       0.4.0 enabled    dokku core docker-options plugin
  domains              0.4.0 enabled    dokku core domains plugin
  enter                0.4.0 enabled    dokku core enter plugin
  git                  0.4.0 enabled    dokku core git plugin
  logs                 0.4.0 enabled    dokku core logs plugin
  mysql                1.0.0 enabled    dokku mysql service plugin
  named-containers     0.4.0.1 enabled    dokku core named containers plugin
  nginx-vhosts         0.4.0 enabled    dokku core nginx-vhosts plugin
  plugin               0.4.0 enabled    dokku core plugin plugin
  postgres             1.0.0 enabled    dokku postgres service plugin
  ps                   0.4.0 enabled    dokku core ps plugin
  shell                0.4.0 enabled    dokku core shell plugin
  tags                 0.4.0 enabled    dokku core tags plugin
  tar                  0.4.0 enabled    dokku core tar plugin

VPS 详细信息:1 GB 内存/30 GB 磁盘

添加了更新 交换文件。没有任何区别。输出在这里冻结:

...
       lcid@1.0.0 /tmp/build/node_modules/lcid
       invert-kv@1.0.0 /tmp/build/node_modules/invert-kv
       window-size@0.1.4 /tmp/build/node_modules/sass-graph/node_modules/window-size
       y18n@3.2.0 /tmp/build/node_modules/y18n
       progeny@0.5.2 /tmp/build/node_modules/progeny
       fs-mode@1.0.1 /tmp/build/node_modules/fs-mode
       cbify@1.0.0 /tmp/build/node_modules/cbify
       fn-args@1.0.0 /tmp/build/node_modules/fn-args
       promise@6.1.0 /tmp/build/node_modules/promise
       asap@1.0.0 /tmp/build/node_modules/asap
       ecc-jsbn@0.1.1 /tmp/build/node_modules/ecc-jsbn
       jsbn@0.1.0 /tmp/build/node_modules/jsbn
       jodid25519@1.0.2 /tmp/build/node_modules/jodid25519
       tweetnacl@0.13.3 /tmp/build/node_modules/tweetnacl
       npm WARN package.json @ No license field.
       Running default compile
       You need to have Sass on your system
       Execute `gem install sass`
       11 Jan 20:49:49 - info: compiling
4

1 回答 1

2

解决了,有点乱,但它有效!

添加 Gemfile

source 'https://rubygems.org'
ruby '2.3.1'
gem 'sass'

bundle install 

(生成 Gemfile.lock)。( gem install bundler, 获取对 bundle 的访问权限)

将 ruby​​ buildpack 添加到 buildpacks: 在文件 .buildpacks 中添加

https://github.com/heroku/heroku-buildpack-ruby

...在文件顶部 (!)

保存,推送,工作!:D 快乐的舞蹈

有帮助:https ://github.com/gjaldon/heroku-buildpack-phoenix-static

于 2016-11-20T22:46:55.337 回答