Rule モジュール関連



drushコマンドでアップデイト時にエラーになる、例えば、xxxxx/modules/rules/modules/, line 147 などで止まってしまう場合


環境: Drupal 7.23

まずエラーのRulesモジュールを削除  rm -rf rules

drush cron

drush dl registry_rebuild

drush rr   <--- registry-rebuild

最新版のRulesモジュールを再インストール  drush pm-download rules

drush updb  <-- updatedb

drush cc all

drush cron   




Rebuild the registry table (for classes) and the syste table (for module locations) in a Drupal install.

updatedb (updb)

Apply any database updates required (as with running update.php).

Registry-Rebuild  <--- モジュールではありません

There are times in Drupal 7 when the registry gets hopelessly hosed and you need to rebuild the registry (a list of PHP classes and the files they go with). Sometimes, though, you can't do this regular cache-clear activity because some class is required when the system is trying to bootstrap.

When would you need Registry Rebuild?

You might get something like:

「PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/ on line 11"PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/ on line 11"」

If this happens when you're trying to run update.php, and happens when you're trying to clear your cache, well, you have some trouble. That's what Registry Rebuild is for.

It also may happen that you've moved some module that Drupal requires to bootstrap, and you get a horrible error. Registry Rebuild will also rebuild the system table to get the modules in the right place so you can bootstrap.

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 rrdrush rrdrush rrdrush rrdrush rr