deis / workflow-cli

The CLI for Deis Workflow
http://deis.com
MIT License
31 stars 43 forks source link

Buildpack for Ruby fails to parse a particular syntax #267

Open amingilani opened 7 years ago

amingilani commented 7 years ago

Error

Heroku runs my Gemfile file fine, as does the heroku local command.

$ git push deis master
Counting objects: 937, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (876/876), done.
Writing objects: 100% (937/937), 214.60 KiB | 0 bytes/s, done.
Total 937 (delta 503), reused 58 (delta 2)
Starting build... but first, coffee!
...
...
...
...
...
...
...
...
...
...
...
...
-----> Restoring cache...
       No cache file found. If this is the first deploy, it will be created now.
-----> Ruby app detected
-----> Compiling Ruby/Rails
sh: 1: Gemfile: not found
       !
       !     There was an error parsing your Gemfile, we cannot continue
       !
       !     [!] There was an error parsing `Gemfile`: unknown type of %string - gem 'tzinfo-data', platforms: %i(mingw mswin x64_mingw jruby)
       !     ^
       !     /tmp/build/Gemfile:106: syntax error, unexpected $end
       !     gem 'tzinfo-data', platforms: %i(mingw mswin x64_mingw jruby)
       !     ^. Bundler cannot continue.
       !
       !     #  from /tmp/build/Gemfile:106
       !     #  -------------------------------------------
       !     #  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
       !     >  gem 'tzinfo-data', platforms: %i(mingw mswin x64_mingw jruby)
       !     #  -------------------------------------------
       !
remote: 2016/11/01 13:42:14 Error running git receive hook [Build pod exited with code 1, stopping build.]
To ssh://deis-builder.162.243.174.144.xip.io:32257/payload.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@deis-builder.162.243.174.144.xip.io:32257/payload.git'

Workaround

Replacing the %i() syntax with a [] array fixes this problem.

-- gem 'tzinfo-data', platforms: %i(mingw mswin x64_mingw jruby)
++ gem 'tzinfo-data', platforms: ['mingw', 'mswin', 'x64_mingw', 'jruby']
bacongobbler commented 7 years ago

We're running the exact same buildpack as they are:

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

Can you provide a PR against example-ruby-sinatra that demonstrates this behaviour for testing?

amingilani commented 7 years ago

On it.

amingilani commented 7 years ago

From the discussion at: https://github.com/deis/example-ruby-sinatra/pull/10