Hi there, due to some odd problems with my site, it was advised to rebuild my registry.

I downloaded and installed Drush.
I installed registry_rebuild by:

How To Use Registry Rebuild With Drush
This is the preferred technique, and it should work with multisite installs.

You can just drush dl registry_rebuild and drush will download it into your .drush folder. (Alternately, you can obtain the package another way and copy the folder into .drush yourself.)
Make a backup of your database.
On a multisite install, cd into the site you're rebuilding, as in cd sites/mymultisite
drush rr

Now, in Drush, when I type drush rr I get this error:

<strong>Command rr needs the following module(s) enabled to run:             [error]
registry_rebuild.
The drush command 'rr' could not be executed.                        [error]
</strong>

I then tried drush cache-clear drush and retried drush rr but got the same error.

The error indicates registry rebuild needs to be enable, but the documentation clearly states it is NOT a module and can't be enabled.

Comments

omega8cc’s picture

Status: Active » Postponed (maintainer needs more info)

Where exactly have you uploaded this drush extension?

[EDIT] Also, if you could let us know the Drush version you have installed and Drupal core version in the affected site, it could help to assist you.

unleet’s picture

I had a similar issue (same cause, i.e. installing this "module" into the site).

I discovered that the correct way to install this is:
drush @none dl registry_rebuild

The @none is a built-in drush alias that forces drush to put this into the .drush directory rather than try to install it into your (probably broken) site.

omega8cc’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I guess it may depend on the Drush version used or where you are currently in the directory tree, but Drush 6 will download this extension where expected without any alias specified -- here is an example from BOA where registry_rebuild is already installed in a write-protected mode:

o1.ftp:~$ drush dl registry_rebuild
Directory /home/o1.ftp/.drush exists, but is not writable. Please check directory permissions.         [error]
Project registry_rebuild (7.x-2.2) could not be downloaded to /home/o1.ftp/.drush/registry_rebuild.    [error]
o1.ftp:~$ drush --version
 Drush Version   :  6.5-dev

o1.ftp:~$
unleet’s picture

I guess it may depend on the Drush version used

That wouldn't surprise me.

For legacy reasons we're stuck on Drush 5 here, and using it, the @none is definitely needed, especially if you've set up your drushrc to allow commands to affect the installed default site from anywhere in the filesystem.

Déjà vu’s picture

thanks #2 solution works like a charm :)

omega8cc’s picture

Status: Closed (works as designed) » Fixed

Added per @unleet suggestion on the project page. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avinash_thombre’s picture

Make sure the registry_rebuild module is installed in .drush folder. It should not be in site folders. For that, navigate to folder where drush has been installed; generally it'd be like this - "C:\Users\username\.drush\". Open this folder and right click n open "Git bash here". Then run the command - drush dl registry_rebuild. It'd download the registry rebuild module in the folder.

Before rebuilding the registry, clear drush cache with - drush cc drush.

Now, navigate to or open git bash inside your site. Navigate inside the site/sites folder and enter drush command - drush rr. That'd scan all modules and make entry of their paths in database.

shobhit_juyal’s picture

thanks for #2