Pivotal Knowledge Base


Failure pushing build pack "`initialize': can't convert nil into String (TypeError)"


Pivotal Web Services (PWS): All versions 


You are pushing an a Ruby based application and seeing the following error.

[STG]     OUT -----> Installing dependencies using 1.6.3
[STG]     OUT        Purging Cache. Changing stack from cedar to
[STG]     OUT        Fixing nokogiri install. Clearing bundler cache.
[STG]     OUT        See https://github.com/sparklemotion/nokogiri/issues/923.
[STG]     ERR /usr/lib/ruby/1.9.1/pathname.rb:308:in `initialize': can't convert nil into String (TypeError)


To avoid the error displayed above, set an environment variable called `STACK` to `` (i.e. an empty string).  There are two ways that this can be done.

  1. By using the `cf set-env` command.
    cf set-env <app-name> STACK ""
  2. By modifying the `env` block of your manifest.yml file.
    - name: <app-name>
      memory: <memory-limit>
      path: .
        STACK: ""

This works to resolve the issue as the presence of the `STACK` environment variable causes the build pack to avoid the code path which triggers this error.

Additional Information

While less convenient, it is also possible to resolve this issue by deleting your application and pushing it again.

cf delete <app-name>

This resolves the issue because it clears out the build pack cache, which when in a certain state is another one of the triggers for this problem.



Powered by Zendesk