1
votes

I have downloaded drush and cofigured it properly .Now I am trying to download a module "themekey" and install it to my drupal .Its downloading properly using

drush dl themekey

but when I try to install it using

drush en -y themekey

I get this error

drush en -y themekey
Command pm-enable needs a higher bootstrap level to run - you will   [error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en themekey' could not be executed.               [error]
A Drupal installation directory could not be found

Please help me in this , I am new in drpal drush and did not find way to solve this Here is my drupal folder

 /opt/lampp/htdocs/projects/drupal_test/
2
@TheodorosPloumis I tried to change localhost to 127.0.0.1 .Other than this I didn't find anything sort out my problemRon

2 Answers

3
votes

You need a working drupal installation, meaning php can be executed the mysql server can be reached. Then you have to change into the root directory of your installation - in your case:

cd /opt/lampp/htdocs/projects/drupal_test/

and execute the command:

drush en modulename -y

For debugging use

drush rq

1
votes

If you tried changing localhost to 127.0.0.1 in settings and it still doesn't work, please have a look at the solution I found here:

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!