A Drupal installation directory could not be found
Command pm-enable needs a higher bootstrap level to run...

Comments

mjmeintjes’s picture

I have the same problem

Grayside’s picture

Version: 6.x-9.10-beta1 » 7.x-10.10-beta1
Priority: Normal » Major

Bump. This is still an issue. I consider this a major roadblock in my ability to use this in a drupal development environment. I don't uses aliases too often, but my efforts to drop those in are met with the same error.

owen barton’s picture

I can't reproduce this - can you describe what you are doing in more detail here?

Grayside’s picture

This really appears to be a problem with any site bootstrapping command.
As far as I know, the only unusual things I am doing are running Kubuntu instead of Ubuntu, and doing it inside VM Ware.

$> drush dsa demo.drupal
// Go log in and reset password
$> cd ~/workspace/demo.drupal
$> drush en devel

EDIT: Debuggable breakthrough! By cd-ing directly into the site directory, it doesn't have the Drupal root in the path. (symlinks you know). When I cd through ~/workspace/[platform]/sites/demo.drupal.localhost it works.

owen barton’s picture

OK - so it looks like our magic "r" and "l" code in drubuntu_drush_init() is no longer working correctly. Should be easy enough to fix though. I also want to extend this function to also create generative aliases for each site (aliases are more flexible for syncing operations, and you can easily "materialize" them to your settings file using a command like drush sa site >> ~/.drush/aliases.drushrc.php, where you can refine them (e.g. to set site specific options).

dqd’s picture

drush avoids bootstrap requests like 'en' if the cd path of the shell command line tool is not showing inside of the drupal installation. What means:
www/htdocs/somewhere-default/ $ drush en testmodule
... does not work, even if the drupal installation root path is set in the drush options correctly, but:
www/htdocs/inside-your-drupal-installation/ $ drush en testmodule
works.

Steve Miller’s picture

I had the same problem, and the same kind of workaround. I have a bash script with the following lines that execute properly, and even gives me a warning if the modules are already there:

> drush dl l10n_server --destination=/var/www/html/sites/all/modules
> drush dl l10n_pconfig --destination=/var/www/html/sites/all/modules
> drush dl l10n_update --destination=/var/www/html/sites/all/modules

Then I try to enable them:

> drush -y pm-enable l10n_server l10n_community l10n_gettext l10n_pconfig l10n_update

This doesn't work from the directory where the bash script is. But it *does* work in /var/www/html/sites/all/modules. So a workaround in the script is to first change to the directory:

> cd /var/www/html/sites/all/modules
> drush -y pm-enable l10n_server l10n_community l10n_gettext l10n_pconfig l10n_update

(Still verifying if modules installed correctly.)

pratik60’s picture

Two popular solutions out there

sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

That's what worked for me.

THe other solution is changing to 127.0.0.1 on your settings.php instead of localhost

robbdavis’s picture

Issue summary: View changes

Thanks @pratik60. Quick question. Where do I put the /var/mysql directory? i.e. should I cd to a specific location before running those commands?

robbdavis’s picture

OK I found a different solution that worked for me.

I found it here http://log.itto.be/?p=1127.

" Drush: “Command pm-enable needs a higher bootstrap level to run”

When running drush you can run into this error message. In my case, the mysql command line tool provided with Mamp Pro was not available. You can easily test this by typing the command ‘mysql’ in terminal. Your output might be -bash: mysql: command not found.

To solve this, do the following in terminal:
sudo vim ~/.bash_profile
Press i
Move to the last line and append
export PATH=/Applications/MAMP/Library/bin/:$PATH
Hit escape
Type in :wq (including the colon) to write the file and quit vim.
Reload your profile by running source ~/.bash_profile.

The mysql command AND drush should now work!"