Extensions trouble in 0.6.7

Is anyone having trouble migrating extensions with the 0.6.7 release?
After exporting the reorder extension I ran a migration and get this
error:

  *******************************************************************
  * config.breakpoint_server has been deprecated and has no effect.
  • *******************************************************************
    

rake aborted!
uninitialized constant ApplicationController

I know that shards is now baked in but the readme of reorder says it
needs shards installed to run, so just in case I installed shards and
ran a db migration and get a similar error:

  *******************************************************************
  * config.breakpoint_server has been deprecated and has no effect.
  • *******************************************************************
    

Could not load extension from file: shards_extension.
#<NameError: uninitialized constant ShardsExtension>
rake aborted!
uninitialized constant ApplicationController

Anyone else getting this and know how to resolve it? Any help would be
appreciated guys!

shane

Shane,

Try two things and then get back to us:

  1. Run rake radiant:update to copy the new config files from the
    gem/vendor.
  2. Remove :shards from config.extensions in config/environment.rb if it
    exists.

Sean

Sean C. wrote:

Shane,

Try two things and then get back to us:

  1. Run rake radiant:update to copy the new config files from the
    gem/vendor.
  2. Remove :shards from config.extensions in config/environment.rb if it
    exists.

Sean

I’m assuming it’s okay to leave shards in the extensions folder while
following your directions. Getting this:

  *******************************************************************
  * config.breakpoint_server has been deprecated and has no effect. 
  • *******************************************************************
    

Could not load extension from file: shards_extension.
#<NameError: uninitialized constant ShardsExtension>
rake aborted!
uninitialized constant ApplicationController

shane

Shane,

Try removing all extensions from loading while doing this. Edit the
appropriate line of config/environment.rb to read:

config.extensions = []

Also, comment out the line in config/environments/development.rb that
starts ‘config.breakpoint_server’

config.breakpoint_server = …

That will get rid of the warning. Then when those tasks have been run,
restore your config.extensions line.

Sean

HI,
could be a similar problem to the one that i had with the reorder
extension, because during my several try-outs i got same error
messages.
Probably the extension needs to have a reference to the app now, since
shards is in there now.
Something like:

require_dependency ‘application’

But i have to say, i’m no ruby expert and i don’t know the guts of
radiant.
best,
Jan

Sean C. wrote:

Shane,

Try removing all extensions from loading while doing this. Edit the
appropriate line of config/environment.rb to read:

config.extensions = []

Also, comment out the line in config/environments/development.rb that
starts ‘config.breakpoint_server’

config.breakpoint_server = …

That will get rid of the warning. Then when those tasks have been run,
restore your config.extensions line.

Sean

I followed the directions… Side note, my environments.rb file had the
config.extensions line already commented out but I continued on anyway
with your suggestions? It looks like the migration worked but when I
tried to start the server I got this error:

=> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)
=> Rails application starting on http://0.0.0.0:7000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:7000
** Starting Rails with production environment…
Could not load extension from file: shards_extension.
#<NameError: uninitialized constant ShardsExtension>
Exiting
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:266:in
load_missing_constant': uninitialized constant ApplicationController (NameError) from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in const_missing’
from
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in
const_missing' from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/app/controllers/admin/abstract_model_controller.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in gem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in require' from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in require’
from
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in require’
… 50 levels…
from
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/railties/lib/commands/server.rb:39
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in require’
from script/server:3

It wasn’t really mentioned but since 0.6.7 has shards baked in do I
still need shards installed to run reorder?

shane

no, you don’t need shards, if you’re trying to (re-)install reorder,
have a look at the other thread.
j

Sean,

Thanks for your patience. I’m not sure what I’m doing wrong. Here is
what I’ve done:

  • exported mailer and reorder to the /vendor/extensions/ folder
  • commented out the config.extensions line in /config/environment.rb
  • commented out the config.breakpoint_server = true line in
    /config/environments/development.rb
  • rake db:migrate:extensions and getting this error:

rake aborted!
uninitialized constant ApplicationController

shane

Shane,

No, please remove shards, it will break things.

Sean

Sean,

I Forgot to mention that I removed shards from the extensions folder…

shane

Shane,

Can you run the rake task with the --trace option and put the results in
a pastie? (http://pastie.org)

Sean

Sean,

Sure thing.

http://pastie.org/207596

shane

Shane,

The problem lies in a minor bug in the reorder extension. I’ll push up
the change today to github.

Sean

Shards in 0.6.7 ???

In my efforts to migrate I found this:
http://blog.leetsoft.com/2006/5/29/easy-migration-between-databases

But when I tried it I got

$ radiant -v
Radiant 0.6.7
$ rake production db:backup:write
(in /home/anton/Ruby/Radiant)
rake aborted!
The Shards extension is required and must be loaded first!

What’s up?

Benny D. said the following on 03/06/08 02:55 PM:

your other extensions is still looking for it. Some extensions check for
the presence of the shards extension in their activate method, and raise
the error you pasted when they cannot find it.

Search for this line in your extensions, and comment it out;

raise “The Shards extension is required and must be loaded first!”
unless defined?(Shards)

Thanks.

It was in copy_move.


Results! Why, man, I have gotten a lot of results. I know several
thousand things that won’t work.
Thomas A. Edison

$ radiant -v
Radiant 0.6.7
$ rake production db:backup:write
(in /home/anton/Ruby/Radiant)
rake aborted!
The Shards extension is required and must be loaded first!

Anton,

Since 0.6.7, the shards extension is indeed no longer needed, but one of
your other extensions is still looking for it. Some extensions check for
the presence of the shards extension in their activate method, and raise
the error you pasted when they cannot find it.

Search for this line in your extensions, and comment it out;

raise “The Shards extension is required and must be loaded first!”
unless defined?(Shards)

Note to developers –

Just like in Javascript, it’s better to test for the objects you need.
This could have been obviated by testing for admin.page rather than
Shards, which was just a module namespace for injected modifications.
(Sorry to pick on you, Andrea)

Sean

Sean,

Would you mind posting here when the revised reorder extension is
available? And will the link still be?:

http://svn.radiantcms.org/radiant/tags/rel_0-6-7/extensions/reorder/

Thanks again for all of your help and patience! I love Radiant and have
used it on all my recent projects. Keep up the great work…

shane

Benny D. said the following on 03/06/08 02:55 PM:

your other extensions is still looking for it. Some extensions check for
the presence of the shards extension in their activate method, and raise
the error you pasted when they cannot find it.

Search for this line in your extensions, and comment it out;

raise “The Shards extension is required and must be loaded first!”
unless defined?(Shards)

I spoke too soon.

$ rake production db:backup:write
(in /home/anton/Ruby/Radiant)
Writing config…
rake aborted!
undefined method `find’ for Config:Module


The great tragedy of Science - the slaying of a beautiful hypothesis by
an ugly fact.
Thomas H. Huxley

Shane,

The latest is on github, which we will be moving to permanently within
the next month. We also have a solution in the works for the
sub-projects/extensions issue.

$ git clone git://github.com/seancribbs/radiant.git
$ cp -r radiant/extensions/reorder
/path/to/your/project/vendor/extensions

Sean