# Failure to install Page Attachments extension

**URL:** <https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721>\
**Category:** Radiant CMS\
**Created:** [June 17, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721 "2008-06-17T22:50:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 17, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/1 "2008-06-17T22:50:47Z")

</div>

I’m trying to follow the instructions at  
[http://wiki.radiantcms.org/Installing\_Extension\_-\_Page\_Attachments](http://wiki.radiantcms.org/Installing_Extension_-_Page_Attachments). When  
I get to this step:

rake production db:migrate:extensions

The output is:

rake aborted!  
undefined method `[]’ for #Enumerable::Enumerator:0x24c267c

From that point on, my server will no longer start up as well.

This is on Leopard, with  
ruby 1.8.7 (2008-06-09 patchlevel 17) [i686-darwin9.3.0]  
rails 2.1.0

Any suggestions would be appreciated!

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 18, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/2 "2008-06-18T22:11:56Z")

</div>

Matt Anderson wrote:

> Any suggestions would be appreciated!

I just successfully installed Page Attachments on version 0.6.7.

I followed the guide (although much of it is outdated and no longer  
necessary).

All you have to do is:

1. Install attachment\_fu:

$ svn export  
[http://svn.techno-weenie.net/projects/plugins/attachment\_fu/](http://svn.techno-weenie.net/projects/plugins/attachment_fu/)  
vendor/plugins/attachment\_fu

1. Download the page\_attachments extension into the proper directory

$ cd /path/to/my/radiant/project  
$ svn checkout  
[http://svn.radiantcms.org/radiant/trunk/extensions/page\_attachments](http://svn.radiantcms.org/radiant/trunk/extensions/page_attachments)  
vendor/extensions/page\_attachments

1. Now run the extension migrations:

$ rake production db:migrate:extensions

1. Run the â€˜updateâ€™ task to copy the appropriate assets from the  
page\_attachments extension:

$ rake production radiant:extensions:page\_attachments:update

1. Restart your application and/or web server.

With Phusion Passenger:

$ cd tmp  
$ touch restart.txt

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 18, 2008, 11:36pm UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/3 "2008-06-18T23:36:15Z")

</div>

I think your problem might be with ruby 1.8.7, there were some changes  
to Enumerable::Enumerator that are possibly incompatible. Can you try  
going back to 1.8.6 and see if you get the same error?

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 18, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/4 "2008-06-18T23:14:01Z")

</div>

Ben M. wrote:

> 1. Now run the extension migrations:
> 
> $ rake production db:migrate:extensions

Same result: after trying that command, the output was

rake aborted!  
undefined method `[]’ for #Enumerable::Enumerator:0x26cbef0

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 19, 2008, 1:27am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/5 "2008-06-19T01:27:30Z")

</div>

Why should the user need to downgrade? 1.8.7 is the current stable  
version of Ruby.

It is Radiant that needs to update. Or, if the devs can’t be bothered  
doing that, at least post a notice on their website saying so.

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 19, 2008, 2:01am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/6 "2008-06-19T02:01:19Z")

</div>

john muhl wrote:

> I think your problem might be with ruby 1.8.7

Reverting to 1.8.6 seems to have fixed it, guess I got ahead of Radiant  
a bit…thanks!

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 19, 2008, 2:01am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/7 "2008-06-19T02:01:51Z")

</div>

Sho Fukamachi wrote:

> Why should the user need to downgrade? 1.8.7 is the current stable  
> version of Ruby.
> 
> It is Radiant that needs to update. Or, if the devs can’t be bothered  
> doing that, at least post a notice on their website saying so.

Hear hear.

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 19, 2008, 8:20am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/8 "2008-06-19T08:20:21Z")

</div>

This mailer extension once worked I think. It still sends email but  
now the attachment part doesn’t work. Am I crazy or missing  
something? Okay I got the note in the todo list but hey this worked  
just a couple of months ago. Does it work for other people?

Steven

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [June 19, 2008, 3:29am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/9 "2008-06-19T03:29:19Z")

</div>

We will heartily accept patches that resolve this issue while  
maintaining compatibility with 1.8.6 and earlier.

Sean

---

<div class="post-metadata">

**Author:** ![madams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@madams](https://www.ruby-forum.com/u/madams)\
**Post date:** [July 9, 2008, 11:52am UTC](https://www.ruby-forum.com/t/failure-to-install-page-attachments-extension/140721/10 "2008-07-09T11:52:22Z")

</div>

Just for reference. I solved this with the patch provided in  
[http://www.mail-archive.com/removed\_email\_address@domain.invalid/msg528878.html](http://www.mail-archive.com/removed_email_address@domain.invalid/msg528878.html).

Just add:

---- 8\< ----  
unless ‘1.9’.respond\_to?(:force\_encoding)  
String.class\_eval do  
begin  
remove\_method :chars  
rescue NameError  
# OK  
end  
end  
end  
---- 8\< ----

To your environment.rb (adding it to config/initializers/ as  
suggested in  
the URL above won’t work in Radiant).

/AITOR
