How to install an extension?

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:inconst_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:inconstantize’
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:inactivate_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:inactivate_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:ininitialize_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:inprocess’
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:inrun’
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:inrequire’
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

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.

On Fri, 5 Oct 2007 15:08:43 +1000, “Daniel S.”
[email protected] 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

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.

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?

On Fri, 5 Oct 2007 15:56:28 +1000, “Daniel S.”
[email protected] 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

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs