# Update Task accidentally run twice (Page Attachments error)

**URL:** <https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646>\
**Category:** Radiant CMS\
**Created:** [May 5, 2008, 3:53am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646 "2008-05-05T03:53:16Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 3:53am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/1 "2008-05-05T03:53:16Z")

</div>

I accidentally ran the rake update task for the Page Attachments  
extension a second time. Now whenever I boot up the server I get the  
following:

vendor/extensions/page\_attachments/lib/geometry.rb:6: warning: already  
initialized constant FLAGS  
vendor/extensions/page\_attachments/lib/geometry.rb:11: warning: already  
initialized constant RFLAGS  
vendor/extensions/page\_attachments/lib/geometry.rb:28: warning: already  
initialized constant RE

Is there a way to go back to the state before the update? I wouldn’t  
otherwise mind, since this doesn’t seem to affect local operation, but  
on Dreamhost, the server doesn’t take kindly to the messages.

Thanks in advance,

Ben

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 7:43am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/2 "2008-05-05T07:43:12Z")

</div>

I get this error as well. Its because rails is seeing two geometry.rb  
files. But what’s weird is that the attachment\_fu plugin and  
page\_attachments extension require geometry.rb separately from each  
other. So if you get rid of either, you’ll get dysfunctional breakage  
both ways. I don’t quite know how to fix it.

Ben M. wrote:

> I accidentally ran the rake update task for the Page Attachments  
> extension a second time. Now whenever I boot up the server I get the  
> following:
> 
> vendor/extensions/page\_attachments/lib/geometry.rb:6: warning: already  
> initialized constant FLAGS  
> vendor/extensions/page\_attachments/lib/geometry.rb:11: warning: already  
> initialized constant RFLAGS  
> vendor/extensions/page\_attachments/lib/geometry.rb:28: warning: already  
> initialized constant RE
> 
> Is there a way to go back to the state before the update? I wouldn’t  
> otherwise mind, since this doesn’t seem to affect local operation, but  
> on Dreamhost, the server doesn’t take kindly to the messages.
> 
> Thanks in advance,
> 
> Ben

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 11:06am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/3 "2008-05-05T11:06:56Z")

</div>

Do you have other extensions installed that use atachment\_fu such as the  
gallery extension?  
On Mon, May 5, 2008 at 3:53 AM, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 1:43pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/4 "2008-05-05T13:43:28Z")

</div>

> Do you have other extensions installed that use atachment\_fu such as the  
> gallery extension?

Yes indeed. Could that be the cause of the conflict?

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 1:57pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/5 "2008-05-05T13:57:08Z")

</div>

On Mon, May 5, 2008 at 1:43 PM, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Do you have other extensions installed that use atachment\_fu such as the  
> > gallery extension?
> 
> Yes indeed. Could that be the cause of the conflict?

Maybe. Both page\_attachments and gallery have the geometry.rb file. Try  
to  
remove it from the second loaded extesion (maybe page\_attachments).

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/6 "2008-05-05T14:33:57Z")

</div>

I’ve also come across this warning but don’t have gallery installed…

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 3:12pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/7 "2008-05-05T15:12:36Z")

</div>

On Mon, May 5, 2008 at 2:34 PM, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> But, if that was the cause, then anyone using Page Attachments and  
> Gallery should have the error. If you have both installed, do you see  
> that message (“already initialized constant FLAGS”) when you start the  
> server?
> 
> Thanks for working with me on this one Andrea, I appreciate it!

What version of radiant, gallery and page\_attachmens are you using?  
Latest  
for all?

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/8 "2008-05-05T14:34:30Z")

</div>

Andrea F. wrote:

> Maybe. Both page\_attachments and gallery have the geometry.rb file. Try  
> to  
> remove it from the second loaded extesion (maybe page\_attachments).

I moved the geometry.rb file out of the page attachments lib directory.  
Upon starting the server I now receive:

\*\* Starting Rails with production environment…  
Could not load extension from file: page\_attachments\_extension.  
#\<MissingSourceFile: no such file to load – vendor/extensions/  
page\_attachments/lib/geometry\>  
\*\* Rails loaded.

But, if that was the cause, then anyone using Page Attachments and  
Gallery should have the error. If you have both installed, do you see  
that message (“already initialized constant FLAGS”) when you start the  
server?

Thanks for working with me on this one Andrea, I appreciate it!

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 4:12pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/9 "2008-05-05T16:12:53Z")

</div>

Yep, all the latest.

Page Attachments 0.2  
Gallery 0.7.10  
Radiant 0.66

I tried uninstalling Page Attachments using:  
rake radiant:extensions:page\_attachments:migrate VERSION=0  
RAILS\_ENV=production  
and deleting the directory in the extensions folder.

I then reinstalled it. Unfortunately, that didn’t work – the  
initialized constants error is still there when the server starts.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 7, 2008, 4:03am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/10 "2008-05-07T04:03:38Z")

</div>

Ben M. wrote:

> Did some more testing, this is interesting…
> 
> I created a new Radiant project with a new database. I then  
> installed the Page Attachments extension (and only that extension). I  
> started the server.
> 
> I see the same error messages:

The “Geometry” class, which apparently has something to do with  
calculating geometry strings to be passed to Imagemagick, gets loaded  
twice - once by Page Attachments and once by Attachment\_fu. Rails is  
warning you that the constants the class contains are getting redefined-  
these are just warnings, and the constants are getting redefined to the  
same values either way. It’s safe to ignore them.

\*\*

I’ve been doing a bunch of work on the Page Attachments plugin - I’ve  
fixed it to not require the Geometry class if the class has already been  
loaded. On my install, this has fixed the warnings.

I’ll issue a pull request and hopefully Sean will like what he sees and  
this’ll make it’s way into the core. There are a few other ways to fix  
it - but this seems like a safe route to me.

–DJCP

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 5, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/11 "2008-05-05T18:31:09Z")

</div>

Did some more testing, this is interesting…

I created a new Radiant project with a new database. I then  
installed the Page Attachments extension (and only that extension). I  
started the server.

I see the same error messages:

\deleteme\>ruby script/server -e production  
=\> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)  
=\> Rails application starting on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server  
\*\* Starting Mongrel listening at 0.0.0.0:3000  
\*\* Starting Rails with production environment…  
/deleteme/vendor/extensions/page\_attachments/lib/geometry.rb:6: warning:  
already initialized constant FLAGS  
/deleteme/vendor/extensions/page\_attachments/lib/geometry.rb:11:  
warning: already initialized constant RFLAGS  
/deleteme/vendor/extensions/page\_attachments/lib/geometry.rb:28:  
warning: already initialized constant RE  
\*\* Rails loaded.  
\*\* Loading any Rails specific GemPlugins  
\*\* Signals ready. INT =\> stop (no restart).  
\*\* Mongrel 1.1.2 available at 0.0.0.0:3000  
\*\* Use CTRL-C to stop.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 7, 2008, 4:05am UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/12 "2008-05-07T04:05:40Z")

</div>

Oh - and all the “update” task does is copy some files in  
RAILS\_ROOT/public. You can run it a thousand times and it wouldn’t have  
an impact on these warnings.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 7, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/13 "2008-05-07T17:07:09Z")

</div>

Daniel Collis-puro wrote:

> I’ve been doing a bunch of work on the Page Attachments plugin - I’ve  
> fixed it to not require the Geometry class if the class has already been  
> loaded. On my install, this has fixed the warnings.

That’s all great to hear, Daniel! Thank you for your effort!

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 7, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/14 "2008-05-07T16:38:20Z")

</div>

Daniel Collis-puro wrote:

> I’ve been doing a bunch of work on the Page Attachments plugin - I’ve  
> fixed it to not require the Geometry class if the class has already been  
> loaded. On my install, this has fixed the warnings.

Thanks for your work on this, Daniel.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [May 7, 2008, 5:13pm UTC](https://www.ruby-forum.com/t/update-task-accidentally-run-twice-page-attachments-error/136646/15 "2008-05-07T17:13:26Z")

</div>

Ben M. wrote:

> Daniel Collis-puro wrote:
> 
> > I’ve been doing a bunch of work on the Page Attachments plugin - I’ve  
> > fixed it to not require the Geometry class if the class has already been  
> > loaded. On my install, this has fixed the warnings.
> 
> That’s all great to hear, Daniel! Thank you for your effort!

No prob.

Here’s the fix, BTW.

[http://github.com/djcp/radiant/commit/44eb8b62406f205e72a4103eeeac6f452f89479e](http://github.com/djcp/radiant/commit/44eb8b62406f205e72a4103eeeac6f452f89479e)

–DJCP
