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

Is v0.13.x going to be compatible with Ruby 2.0.0? #672

Open
5thWall opened this issue Jul 28, 2016 · 12 comments
Open

Is v0.13.x going to be compatible with Ruby 2.0.0? #672

5thWall opened this issue Jul 28, 2016 · 12 comments

Comments

@5thWall
Copy link

5thWall commented Jul 28, 2016

I have a new Rails project using rabl v0.13.0 and I'm getting this error.

lib/rabl/digestor.rb:6: syntax error, unexpected ',' (SyntaxError)
      def self.digest(name:, finder:, **options)
@krzysiek1507
Copy link

@5thWall what is your ruby version?

@5thWall
Copy link
Author

5thWall commented Jul 28, 2016

2.0.0-p648 unfortunately. I didn't realize that was a method definition so error makes sense. I understand if you're dropping support for such an old version.

@krzysiek1507
Copy link

@5thWall and what is your version of Rails?

@krzysiek1507
Copy link

The problem is described here: https://robots.thoughtbot.com/ruby-2-keyword-arguments#required-keyword-arguments It's Ruby 2.1

@5thWall
Copy link
Author

5thWall commented Jul 28, 2016

So is Ruby 2.0.0 not being supported? The Travis config lists all the way down to 1.9.3.

@krzysiek1507
Copy link

@5thWall But not with Rails 5. Rails 5 requires Ruby >= 2.2.2.

@5thWall 5thWall changed the title Syntax Error in v0.13.0 Is v0.13.x going to be compatible with Ruby 2.0.0? Jul 28, 2016
@seandmccarthy
Copy link

Can the gemspec be updated to indicate the minimum Ruby version supported for subsequent releases? I got caught out on this and first checked the compatibility info reported by Rubygems.

@swordfish444
Copy link

@krzysiek1507 Does RABL work on Ruby 2.5 and Rails 5.1?

@richessler
Copy link

Bump on this.

Just upgrade Ruby to 2.5.1 and Rails to 5.2.1 and my views were unchanged but whenever I try to render a partial or extend another view it bombs.

cc: @nesquena @krzysiek1507

@databyte
Copy link
Collaborator

The tests pass for ruby-2-5-1 so we're missing something in the tests. Can someone provide their template or a new rails app that reproduces the issue?

@richessler
Copy link

richessler commented Oct 11, 2018

@databyte
what breaks my app is this

child :map_author, object_root: false  do
    extends('api/v2/maps/map_author')
  end

 child :map_audios, object_root: false  do
    extends('api/v2/maps/map_audios')
  end

and in the template is

#/views/api/v2/_author.rabl
object @map_author
cache root_object
attributes :id, :name, :description, :photo_file, :photo_s3
node(:photo_url) { |a| "#{ENV['S3_BUCKET_URL']}/#{URI.encode(a.photo_s3)}" unless a.photo_s3.nil? }

#/views/api/v2/_map_audios.rabl
collection @map_audios
cache root_object
attributes :id, :map_id, :name, :description, :file, :file_s3, :created_at, :updated_at
node(:url) { |a| "#{ENV['S3_BUCKET_URL']}/#{URI.encode(a.file_s3)}" unless a.file_s3.nil? }

@databyte
Copy link
Collaborator

That's a big file and I don't have all the variables and database fields that go with it. To help out, if you were to comment out each line one by one - can you find the breaking line? Think git bisect but for rabl template file troubleshooting.

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

No branches or pull requests

6 participants