an observation about extensions

0 views
Skip to first unread message

jhearn

unread,
Mar 15, 2009, 1:02:25 PM3/15/09
to Radiant CMS: Dev
I think it would be very nice if there was sort of a convention where
extension developers were to put "sytem requirements" for their
extension somewhere obvious on its github page. So I would not, for
instance, run the ray rake command to install, say, twitter, only to
find that because the hpricot and activesupport gems aren't installed
the rake aborts, but my passenger restarts anyway and my site has a
"Rails Application Failed to Start" error.

I guess a more robust solution would be to have ray check the system
requirements before it writes anything, but I'm not sure how feasible
that is.

john muhl

unread,
Mar 15, 2009, 2:05:26 PM3/15/09
to radiant...@googlegroups.com

what version of ray are you using?

in the latest version of ray an aborted rake task should cause ray to
disable the extension and stop any further actions, including
restarting your server. if you're using the latest version of ray and
it didn't handle some error i'll be sure to take a look specifically
at the twitter extension to see where i'm failing to catch errors.

the latest version also includes basic support to let authors declare
their extension's dependency on other extensions and/or gems. i tried
to provide patches to as many extensions as i could find who would
benefit from this but obviously missed some, including the twitter
extension. there is a page on the ray wiki describing how to declare
dependencies[1], providing patches to authors of the extensions you
use should be simple enough.

beyond the existing error handling and giving authors a way to tell
ray what their dependencies are there isn't much more i can do.
determining the extension requirements based solely on inspecting the
extension's source code would be far too much effort and probably not
very effective.

p.s. activesupport should be in the version of rails bundled with
radiant, so complaints about that being missing are very strange.

[1]: http://wiki.github.com/johnmuhl/radiant-ray-extension/extension-dependencies

jhearn

unread,
Mar 15, 2009, 4:33:28 PM3/15/09
to Radiant CMS: Dev
I was using version 1.3. I had run "rake ray:update" this morning,
and got the message "Ray is up to date." I hadn't realized there was a
new method for performing updates. I used the new method from the ray
wiki, and it seems to have worked okay, but still shows as 1.3 on the
extensions page.

I tried installing twitter again after the update. It succeeds, but
breaks my deployment. rake ray:d name=twitter fixes it.

As far as why activesupport was found to be missing, or why twitter
causes problems...thats really beyond the scope of my understanding.
I am deployed on Dreamhost, which seems to bring with it a bevy of
hang-ups and caveats. I don't really see how that should matter if
the necessary gems are rolled into the app, but thats the only
"unusual" detail about my deployment that I can think of.

Thanks for the quick reply. If there is any other info I can provide
that would be useful, I'll try to answer your questions.

-John
> [1]:http://wiki.github.com/johnmuhl/radiant-ray-extension/extension-depen...

john muhl

unread,
Mar 15, 2009, 6:11:40 PM3/15/09
to radiant...@googlegroups.com
On Sun, Mar 15, 2009 at 2:33 PM, jhearn <jhe...@gmail.com> wrote:
>
> I was using version 1.3.  I had run "rake ray:update" this morning,
> and got the message "Ray is up to date." I hadn't realized there was a
> new method for performing updates.  I used the new method from the ray
> wiki, and it seems to have worked okay, but still shows as 1.3 on the
> extensions page.

if you still see 1.3 in the admin you probably just need to restart
passenger for that change to get picked up.

> I tried installing twitter again after the update.  It succeeds, but
> breaks my deployment.  rake ray:d name=twitter fixes it.

that you could run that command means you are on version 2 regardless
what the admin interface says.

on my local computer i setup a styled blog template, ran
script/extension install ray, then rake ray:i name=twitter and got
this:

================================================================================
The twitter extension failed to install properly.
Specifically, the failure was caused by the extension's migrate task:
Run `rake radiant:extensions:twitter:migrate --trace` for more details.
The extension has been disabled and placed in vendor/extensions/.disabled
================================================================================

the server didn't restart and even after doing so i can still login,
edit pages and view the front end of the site.

what output did you get? did it say it installed successfully? just
abort with no messages at all?

> As far as why activesupport was found to be missing, or why twitter
> causes problems...thats really beyond the scope of my understanding.
> I am deployed on Dreamhost, which seems to bring with it a bevy of
> hang-ups and caveats.  I don't really see how that should matter if
> the necessary gems are rolled into the app, but thats the only
> "unusual" detail about my deployment that I can think of.

gems like hpricot can't be bundled with the extension because they
need to be compiled for the system it will be run on, gems which don't
require compiling should as you suggest just be bundled in the
extension.

jhearn

unread,
Mar 15, 2009, 7:10:59 PM3/15/09
to Radiant CMS: Dev
I frequently forget to end my ssh sessions before putting my laptop to
sleep, so my bash_history on the dreamhost server isn't really a
reliable source of information. Here is what I think my process
looked like.

running ray 1.3:
>rake production ray:ext name=twitter hub=seancribbs fullname=radiant-twitter-extension

this griped that i needed the twitter gem, so did gem install. that
might have prepended the installation of HTTParty, iirc.

tried again, rake aborts, needs hpricot, but ray says extension was
installed. that seems bad, so i ran
> rake ray:rm name=twitter

gem install, try again. rake aborts, needs activesupport. again, ray
indicates twitter was installed. at this point i notice that my
radiant deployment is broken.

rake ray:rm fails because it can't overwrite the twitter directory in
disabled extensions or something along those lines. i manually trash
the vendor/extensions/twitter directory. this brings radiant back
online.

i do the gem install, try installing twitter extension. no errors,
but breaks deployment again. ray still wont remove, so i trash it
again, radiant works again.

after exchange above, i ran in vendor/extension/ray
> git pull origin master

tried extension install again, no errors, but radiant breaks. this
time, ran the following successfully:
> rake ray:d name=twitter

radiant is working, twitter isn't. thats where i left it.

ray does show up as 2.0, now. somewhere in there, the Archive
extension showed up... around the time i updated to ray 2.0, i think,
but I don't remember installing it.

-j
Reply all
Reply to author
Forward
0 new messages