# Aws/s3 Requires Rails 1.2?

**URL:** <https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159>\
**Category:** Rails\
**Created:** [December 21, 2006, 8:25pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159 "2006-12-21T20:25:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [December 21, 2006, 8:25pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/1 "2006-12-21T20:25:25Z")

</div>

Howdy,

Quick question about the aws/s3 library from Marcel… Does that  
require Rails 1.2?

It works great for me when running against the 1.2RC1 gems but if I  
tell my app to require 1.1.6, then I get this error when starting the  
server:

#\<TypeError: ACL is not a class\>

I didn’t see it in the docs but I was curious if 1.2 was required. If  
not, any idea what’s going on?

Thanks,  
Hunter

---

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [December 21, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/2 "2006-12-21T20:33:28Z")

</div>

On Thu, Dec 21, 2006 at 11:22:55AM -0800, Hunter H. wrote:

> not, any idea what’s going on?  
> That sounds like dependency loading weirdness. If you just plopped the  
> aws  
> code into your plugins directory you might need to explicitly require it  
> in  
> your environment.rb. If you are using it from gems, then something is  
> likely  
> funky. aws/s3’s implementation is completely orthogonal to Rails. The  
> only  
> software that it depends on having a certain version of is Ruby (1.8.2  
> or  
> greater) and the libraries that it has as depencencies.

Having said that, I bet we can get Rails 1.16 to load it up correctly.  
Just  
let me know how you are hooking it into the app. Via the plugins  
directory or  
via rubygems. Where are you referencing it in your app? Required in  
environment.rb or just const missing magic?

## marcel

Marcel Molina Jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [December 21, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/3 "2006-12-21T20:53:31Z")

</div>

Hey Marcel,

I am using aws via gems, not as a plug-in.

I am requiring it in my environment.rb file (and that’s where it is  
choking - if I comment that out, all is well). I am adding the  
following to environment.rb:

require ‘aws/s3’  
include AWS::S3

I then go on to use it in several places in the app.

It works great with 1.2, by the way. It’s just 1.1.6 that chokes.

Cheers,  
Hunter

---

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [December 21, 2006, 8:57pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/4 "2006-12-21T20:57:32Z")

</div>

On Thu, Dec 21, 2006 at 11:51:43AM -0800, Hunter H. wrote:

> include AWS::S3
> 
> I then go on to use it in several places in the app.
> 
> It works great with 1.2, by the way. It’s just 1.1.6 that chokes.

Ah, that’s what it is. I think ActionWebService has an ACL module, or  
maybe  
someting in ActionMailer does, so since that is already loaded, when you  
include AWS::S3 it sees the ACL class and isn’t happy.

You can instead do

include AWS

And then you should be fine, though you’ll have to change your code to  
say  
S3::Bucket or whatever.

## marcel

Marcel Molina Jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [December 21, 2006, 9:09pm UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/5 "2006-12-21T21:09:36Z")

</div>

Marcel,

That appears to have worked like a charm.

Thanks,  
Hunter

---

<div class="post-metadata">

**Author:** ![hunter\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bc79bd/32.png) [@hunter\_h](https://www.ruby-forum.com/u/hunter_h)\
**Post date:** [January 28, 2007, 3:47am UTC](https://www.ruby-forum.com/t/aws-s3-requires-rails-1-2/80159/6 "2007-01-28T03:47:13Z")

</div>

Hey Marcel,

I seem to see this collision often, such as in the under-development  
attachment\_fu plug in under Rails 1.2.

Is changing the include the best fix or would it make sense to use a  
class name that doesn’t collide?

Thanks again for the work on the gem. I use it every day.

Hunter
