cloudfoundry / buildpack-packager

Buildpack Packager
Apache License 2.0
23 stars 31 forks source link

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

Closed jameskhedley closed 9 years ago

jameskhedley commented 9 years ago

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

cf-gitbot commented 9 years ago

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.

mhoran commented 9 years ago

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.

jtarchie commented 9 years ago

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

jameskhedley commented 9 years ago

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.

flavorjones commented 9 years ago

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

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