Forum: Ruby on Rails Using engines/datetime toolbocks with another plugin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-04-16 08:58
(Received via mailing list)
Hello,

I'm having trouble using datetime toolbocks (which in turn relies on
engines) with another plugin.  I'm using Goldberg (http://goldberg.
240gl.org/) as a CMS for my rails app.  I have some models with date
fields, and I'd like to use datetime toolbocks in the views that edit
those fields.  With the first version of Goldberg that I installed
( 0.1.6) this worked fine, because at the time Goldberg wasn't a
plugin--it just put all of its MVCs into the usual directories under
the app folder.  Both Goldberg and Datetime toolbocks worked in the
same app.  Now there is a new Goldberg release ( 0.2.0) and the author
has made Goldberg into a plugin.  I've upgraded in order to get the
latest bug fixes, but now I can't get Datetime toolbocks to work.

Specifically, after I install it, my page never loads.  My browser
just keeps saying "waiting for localhost...".

If I uninstall datetime toolbocks and engines, my site works fine
(except for the views that use the calendar control).  If I have
datetime toolbocks and engines installed, but uninstall Goldberg, the
site loads fine and I can use the calendar control.  So the problem
seems to be the interaction of these two.

Does anyone have any ideas how to fix or work around this?

Thanks,
Myron
00e3a96684ab390a350b0271e98741d3?d=identicon&s=25 Nshbrown Nshbrown (nshb)
on 2007-04-16 09:46
(Received via mailing list)
I would try loading the goldberg plugin before the engines and
datetime_toolbocks plugin.

You can do so by modifying the environment.rb file and have the...

config.plugins = ["goldberg", "engines", "*"]

That may solve the conflict. If it doesn't, clear your log files, and
paste what you see in the development log into an email here and that
will help us debug it much more effectively.

Nathaniel.

On 4/15/07, Myron Marston <myron.marston@gmail.com> wrote:
> the app folder.  Both Goldberg and Datetime toolbocks worked in the
> site loads fine and I can use the calendar control.  So the problem
> seems to be the interaction of these two.
>
> Does anyone have any ideas how to fix or work around this?
>
> Thanks,
> Myron
>
>
> >
>


--
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624
42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-04-16 18:00
(Received via mailing list)
Thanks for the quick response, Nathaniel.

I followed your suggestion.  Doing so causes an exception to be thrown
when mongrel starts up (even before I access the app with my
browser).  Here's the stack trace:

F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/loaded_plugins-0.1.0/lib/
loaded_plugins/plugin.rb:18:in `basename': can't convert nil into
String (TypeError)
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/plugin.rb:18:in `name_for'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:74:in
`find_plugin_path'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
lib/initializer.rb:401:in `inject'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:73:in `each'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:73:in
`inject'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:73:in
`find_plugin_path'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:26:in
`load_plugin'
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
lib/initializer.rb:192:in `load_plugins'
         ... 32 levels...
        from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
lib/commands/server.rb:39
        from F:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'
        from F:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `require'
        from script/server:3

My log file only gets one line:

   [4;36;1mSQL (0.078000) [0m    [0;1mSET SQL_AUTO_IS_NULL=0 [0m

Any other ideas?

Thanks!

- Myron
00e3a96684ab390a350b0271e98741d3?d=identicon&s=25 Nshbrown Nshbrown (nshb)
on 2007-04-16 19:36
(Received via mailing list)
I guessed the goldberg plugin name. Is that correct?

Also, looking at the error, I see you are using
loaded_plugins-0.1.0... which is basically another form of Engines.

Having both these won't work.

What are all the plugins you have installed?

Nathaniel.

On 4/16/07, Myron Marston <myron.marston@gmail.com> wrote:
>         from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/
> `inject'
> lib/commands/server.rb:39
> Any other ideas?
> >
> >
> > > ( 0.1.6) this worked fine, because at the time Goldberg wasn't a
> > > (except for the views that use the calendar control).  If I have
> > Nathaniel Steven Henry Brown
> >
> > Toll Free: 1-877-446-4647
> > Vancouver: 604-724-6624
>
>
> >
>


--
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624
42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-04-17 03:56
(Received via mailing list)
Yes, that's the correct plugin name for Goldberg (at least, that's the
name of the directory for the plugin...so that makes it the name,
right?  I'm very new to rails, so I'm still learning this stuff....)

First off, loaded_plugins is in my ruby\lib\ruby\gems\1.8\gems
directory.   I was under the impression that all plugins got loaded
under my rails project folder project, under vendor\plugins.  Is that
incorrect?  The ones I have in my app's vendor\plugins folder (and
that I was aware of installing) are Goldberg, Datetime_toolbocks and
Engines (and I only have engines because the datetime_toolbocks plugin
requires it).

I looked at the loaded_plugins source and did some searching in my
project, and it looks like loaded_plugins is required by another
plugin called plugin_migrations (and this one is also in my ruby\lib
\ruby\gems\1.8\gems directory).  Goldberg in turn uses
plugin_migrations.  I don't think they were used by the original
version of Goldberg installed, but when I upgraded to 0.2.0 and
installed it via gems, it must have installed all dependencies,
including loaded_plugins and plugin_migrations.

Any ideas?  Are goldberg and datetime_toolbocks simply incompatible
because one uses loaded_plugins and the other engines?

Thanks again!
- Myron
00e3a96684ab390a350b0271e98741d3?d=identicon&s=25 Nshbrown Nshbrown (nshb)
on 2007-04-17 07:18
(Received via mailing list)
The loaded plugins is a pluginaweek release.

http://wiki.pluginaweek.org/Loaded_plugins

If loaded_plugins is in fact required by the golbgerb plugin (which it
appears it does), that would render the datetime toolbocks plugin
incompabile as both engines and loaded plugins modify the Rails plugin
handlers quite a bit.

I have read about some plugins being both pluginaweek and engines
compatible. Might be worth investigating. You may very well be able to
rip through the goldberg plugin and remove the inclusion of the
loaded_plugins and the other ones, it may very well work.

Nathaniel.

On 4/16/07, Myron Marston <myron.marston@gmail.com> wrote:
> Engines (and I only have engines because the datetime_toolbocks plugin
>
> > loaded_plugins-0.1.0... which is basically another form of Engines.
> >
> > > String (TypeError)
> > > loaded_plugins-0.1.0/lib/loaded_plugins/loaded_plugins.rb:73:in
> > >         from F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
> >
> > > > You can do so by modifying the environment.rb file and have the...
> >
> > > > > same app.  Now there is a new Goldberg release ( 0.2.0) and the author
> > > > > seems to be the interaction of these two.
> > > > Vancouver: 604-724-6624
> >
> > --
> > Nathaniel Steven Henry Brown
> >
> > Toll Free: 1-877-446-4647
> > Vancouver: 604-724-6624
>
>
> >
>


--
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624
3c0d1a1c67b7b48653bae6e36cd6bb5e?d=identicon&s=25 urbanus (Guest)
on 2007-04-17 15:08
(Received via mailing list)
Hi Guys,

> If loaded_plugins is in fact required by the golbgerb plugin (which it
> appears it does), that would render the datetime toolbocks plugin
> incompabile as both engines and loaded plugins modify the Rails plugin
> handlers quite a bit.
>
> I have read about some plugins being both pluginaweek and engines
> compatible. Might be worth investigating. You may very well be able to
> rip through thegoldbergplugin and remove the inclusion of the
> loaded_plugins and the other ones, it may very well work.

loaded_plugins and plugin_migrations are only used during Goldberg's
database setup.  They get loaded from RAILS_ROOT/vendor/plugins/
goldberg/init.rb:

# Load Plugin Migrations (if available)
begin
  require 'plugin_migrations'
rescue MissingSourceFile
  nil
end

After you've done your `rake goldberg:install` you could comment out
those lines.  They're not necessary for Goldberg at runtime.

If that's the problem, I can fix it: I can move those lines into tasks/
goldberg_tasks.rake, so they never get invoked except when you're
setting up the database.  Would you be able to let me know please?


Regards,
Dave
00e3a96684ab390a350b0271e98741d3?d=identicon&s=25 Nshbrown Nshbrown (nshb)
on 2007-04-18 02:40
(Received via mailing list)
Hey Dave,

That _should_ fix it.

Nathaniel.

On 4/17/07, urbanus <urbanus@240gl.org> wrote:
> > rip through thegoldbergplugin and remove the inclusion of the
>   nil
> Regards,
> Dave
>
>
> >
>


--
Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624
42d4590355a1404230fbc9aff4dd377b?d=identicon&s=25 Myron Marston (Guest)
on 2007-04-18 10:11
(Received via mailing list)
Gentlemen -

Thank you both.  Commenting out the "require 'plugin_migrations' ", as
Dave suggested, worked great.  It sure is nice to be able to use both
plugins!

- Myron
3c0d1a1c67b7b48653bae6e36cd6bb5e?d=identicon&s=25 urbanus (Guest)
on 2007-04-20 08:06
(Received via mailing list)
Hi Myron,

> Thank you both.  Commenting out the "require 'plugin_migrations' ", as
> Dave suggested, worked great.  It sure is nice to be able to use both
> plugins!

Excellent news!  Thanks for letting us know.

Goldberg 0.2.0 was a major release, so I expected some bugs would come
up.  (Fortunately no really serious problems.)  This issue is one of
them.  I'm considering releasing 0.2.1 sooner than planned to clean up
these issues, so keep your eyes open.


Regards,
Dave
This topic is locked and can not be replied to.