# How to install an extension?

**URL:** <https://www.ruby-forum.com/t/how-to-install-an-extension/116402>\
**Category:** Radiant CMS\
**Created:** [October 5, 2007, 7:01am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402 "2007-10-05T07:01:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 7:01am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/1 "2007-10-05T07:01:23Z")

</div>

apparently there is more to installing an extension than simply  
un-tar-ing  
in the vendor/extensions directory and running “rake  
db:migrate:extensions”  
i put the “external\_rss” and “gallery” extensions in the  
vendor/extensions directory,  
ran that rake command, and also ran “rake  
radiant:extensions:external\_rss:update:public”.  
No errors were shown.

However, the admin didn’t show them as extensions.  
so then I restarted the server (does every extension install require a  
full restart?).  
then the thing wouldn’t run at all.  
my apache error log has:

[Fri Oct 05 00:27:16 2007] [notice] mod\_fcgid: server  
/group/apedf.org/public\_html/dispatch.fcgi(29161) started  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:266:in  
`load_missing_constant': uninitialized constant ExternalRssExtension (NameError) from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:in`const\_missing’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:464:in  
`const_missing' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:250:in`constantize’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/core\_ext/string/inflections.rb:148:in  
`constantize' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:70:in`activate\_extensions’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension\_loader.rb:68:in  
`select' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:68:in`activate\_extensions’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension\_loader.rb:42:in  
`run' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:43:in`initialize\_extensions’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:36:in  
`after_initialize' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:114:in`process’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:43:in  
`send' from /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:43:in`run’  
from  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:32:in  
`run' from /group/apedf.org/public_html/../config/environment.rb:15 from /group/apedf.org/public_html/dispatch.fcgi:21:in`require’  
from /group/apedf.org/public\_html/dispatch.fcgi:21  
[Fri Oct 05 00:27:19 2007] [notice] mod\_fcgid: process  
/group/apedf.org/public\_html/dispatch.fcgi(29161) exit(communication  
error), terminated by calling exit(), return code: 1

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 7:15am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/2 "2007-10-05T07:15:59Z")

</div>

> rb:266:in `load\_missing\_constant’: uninitialized constant  
> ExternalRssExtension (NameError)

I’ll hazard a guess that external\_rss isn’t actually the name of that  
extension.  
If it was, there would be an external\_rss\_extension.rb file in the root  
dir of  
the extension, which would be responsible for defining  
ExternalRssExtension.

Extensions are sensitive to being located in a correctly named  
directory. The  
directory should be named the same as the xxxxxx\_extension.rb file in  
the root  
dir.

Dan.

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 7:44am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/3 "2007-10-05T07:44:03Z")

</div>

On Fri, 5 Oct 2007 15:08:43 +1000, “Daniel S.”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) said:

> Extensions are sensitive to being located in a correctly named directory.  
> The  
> directory should be named the same as the xxxxxx\_extension.rb file in the  
> root  
> dir.

Good to know, but in fact there is a  
external\_rss/external\_rss\_extension.rb file that  
does define ExternalRssExtension.  
And I have the same problem with the gallery extension.  
So there must be something else fundamental I’m not doing.

Maybe it is a question of which “vendor” directory to use?  
I’m putting them in the top level myproject/vendor/extensions, although  
I’ve seen something about putting it under public?

-mda

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 7:53am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/4 "2007-10-05T07:53:25Z")

</div>

Mark D. Anderson wrote:

> > ExternalRssExtension.  
> > And I have the same problem with the gallery extension.  
> > So there must be something else fundamental I’m not doing.
> 
> Maybe it is a question of which “vendor” directory to use?  
> I’m putting them in the top level myproject/vendor/extensions, although  
> I’ve seen something about putting it under public?
> 
> -mda

To the best of my knowledge  
myproject/vendor/extensions is correct. public is not.

Cheers,  
Mohit.  
10/5/2007 | 1:52 PM.

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 8:03am UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/5 "2007-10-05T08:03:56Z")

</div>

> Good to know, but in fact there is a  
> external\_rss/external\_rss\_extension.rb file that  
> does define ExternalRssExtension.

So that file is located at:

{RAILS\_ROOT}/vendor/extensions/external\_rss/external\_rss\_extension.rb

Is that correct? Are the permissions on that directory correct?

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/6 "2007-10-05T19:31:15Z")

</div>

On Fri, 5 Oct 2007 15:56:28 +1000, “Daniel S.”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) said:

> > Good to know, but in fact there is a  
> > external\_rss/external\_rss\_extension.rb file that  
> > does define ExternalRssExtension.
> 
> So that file is located at:
> 
> {RAILS\_ROOT}/vendor/extensions/external\_rss/external\_rss\_extension.rb
> 
> Is that correct? Are the permissions on that directory correct?

Yes, that is where it is located.  
The permissions are such that all files are r, and directories are rx  
by the web server (but not writable).

And anyhow I just did a “chown -R www-data vendor/extensions”  
so they are owned by the web user.

I have determined that the extensions work if I use webrick.  
It is only with dispatch.fcgi that I’m having this problem.  
That seems like a useful clue, but I’m confused how it could find that  
the extensions are there, yet not execute the \*\_extension.rb file  
properly?

-mda

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/7 "2007-10-05T21:40:02Z")

</div>

> And anyhow I just did a “chown -R www-data vendor/extensions”  
> so they are owned by the web user.
> 
> I have determined that the extensions work if I use webrick.  
> It is only with dispatch.fcgi that I’m having this problem.  
> That seems like a useful clue, but I’m confused how it could find that  
> the extensions are there, yet not execute the \*\_extension.rb file  
> properly?

So maybe I didn’t know what RAILS\_ROOT is above.  
Is that the directory set up by gem install radiant,  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2  
Or is that the directory set up by running “radiant --database  
postgresql myproject” ?

Anyhow, I just made myproject/vendor/extensions to be a sym link to  
/usr/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/extensions, and now  
my extensions are working fine in dispatch.fcgi and not just webrick.

-mda

---

<div class="post-metadata">

**Author:** ![Mark\_DSAnderson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@Mark\_DSAnderson](https://www.ruby-forum.com/u/Mark_DSAnderson)\
**Post date:** [October 5, 2007, 10:02pm UTC](https://www.ruby-forum.com/t/how-to-install-an-extension/116402/8 "2007-10-05T22:02:17Z")

</div>

> So maybe I didn’t know what RAILS\_ROOT is above.  
> Is that the directory set up by gem install radiant,  
> /usr/lib/ruby/gems/1.8/gems/radiant-0.6.2  
> Or is that the directory set up by running “radiant --database postgresql myproject” ?

The latter. RAILS\_ROOT points to your Radiant project, RADIANT\_ROOT  
points to the Radiant core source files, whether in the gem or in  
vendor/radiant of your project.

Sean
