cloudfoundry/buildpack-packager

package.rb:117: syntax error, unexpected keyword_end, expecting $end

jameskhedley opened this issue · 5 comments

Hi, noob at ruby but was redirected from here as I'm trying to package a local buildpack. I've followed the steps in the md file and am getting the following ruby stack trace:

$ buildpack-packager list
/home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/lib/buildpack/packager.rb:3:in `require': /home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/lib/buildpack/packager/package.rb:83: syntax error, unexpected tLABEL, expecting ')' (SyntaxError)
...ncy_checksum(local_cached_file:, dependency:, from_local_cac...
...                               ^
/home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/lib/buildpack/packager/package.rb:117: syntax error, unexpected keyword_end, expecting $end
from /home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/lib/buildpack/packager.rb:3:in `<top (required)>'
from /home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/bin/buildpack-packager:2:in `require'
from /home/james/.bundler/ruby/1.9.1/buildpack-packager-9264776c1141/bin/buildpack-packager:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/buildpack-packager:23:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/buildpack-packager:23:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'

I looked in package.rb and I can't see any unbalanced end statements. What am I missing?

James

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/101115084.

You are using Ruby 1.9.3 but buildpack-packager requires Ruby 2.1+. The cf.Gemfile in each buildpack specifies the required Ruby version.

Maybe we should lock the version of the supported Ruby for buildpack packager in the gemspec.

Thanks! It's working now. For the uninitiated you can do:

rvm install 2.2.0
rvm --default use 2.2.0

before running step 2 'bundle install'.

Maybe you could add something to make it more obvious that we should use > 2.1? It's not easy to deduce the cause from the error message currently.

Thanks again.

Note that I've created this Tracker story to specify supported Ruby versions in the gemspec:

https://www.pivotaltracker.com/story/show/101610504