Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws-s3 gem unless defined? @@{:instance_writer=>true}

I am trying to integrate the aws-s3 gem with the latest version of Rails (4.1.0), and when starting the server I receive this error:

aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': ///.rvm/gems/ruby-1.9.3-p385/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: syntax error, unexpected $undefined (SyntaxError) unless defined? @@{:instance_writer=>true}

Has anyone got any ideas?

The bulk of the gem has not been updated for over two years so I am thinking that it may finally be out of date.

like image 407
Simon Fletcher Avatar asked Aug 07 '14 20:08

Simon Fletcher


1 Answers

In Rails 4.1 the bug is happening because cattr_attribute was removed from Module.

A short look at the issues in github: they say that the project has been abandoned.

This pull request was to fix the issue: https://github.com/marcel/aws-s3/pull/95

You may want to use one of forks like https://github.com/bartoszkopinski/aws-s3, that fixes the issue, or change the gem to the https://github.com/aws/aws-sdk-ruby.

like image 54
konole Avatar answered Sep 22 '22 14:09

konole