Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildpack for Ruby fails to parse a particular syntax #267

Open
amingilani opened this issue Nov 1, 2016 · 3 comments
Open

Buildpack for Ruby fails to parse a particular syntax #267

amingilani opened this issue Nov 1, 2016 · 3 comments
Assignees
Labels

Comments

@amingilani
Copy link

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://[email protected]: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
Copy link
Member

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
Copy link
Author

On it.

@amingilani
Copy link
Author

From the discussion at: deis/example-ruby-sinatra#10

  • Deis's buildpack is parsing the Gemfile in Ruby 1.9.3, Heroku is parsing it in 2.3.1
  • There's a switch for the ruby version here if app[:is_new] is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants