2014-08-28 205 views
1

我已经下载drush和cofigured得当。现在我想下载一个模块“themekey”,用模块安装给错误

drush dl themekey 

它安装到我的Drupal。其下载正确,但是当我尝试使用

drush en -y themekey 

我得到这个错误

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 

安装它,请帮我在THI S,我在drpal drush新的,并没有找到办法来解决这个 这里是我的Drupal文件夹

/opt/lampp/htdocs/projects/drupal_test/ 
+0

@TheodorosPloumis我试图将localhost更改为127.0.0.1。除此之外,我没有发现任何可以解决问题的东西 – Ron 2014-08-28 12:37:02

回答

3

你需要一个工作Drupal安装,这意味着PHP可以执行MySQL服务器即可到达。然后,你必须变成你安装的根目录下 - 你的情况:

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

,并执行以下命令:

drush en modulename -y

为了调试使用

drush rq

+0

drupal_test是我工作的drupal安装,我正在研究这个问题。请澄清一下, “工作的Drupal安装” – Ron 2014-08-29 06:43:11

+0

谢谢@jojomojo – Ron 2014-08-29 14:26:27

1

如果您尝试在设置中将localhost更改为127.0.0.1,并且我牛逼仍不能正常工作,请看看我发现here解决方案:

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

在运行时drush你可以遇到这样的错误消息。在我的情况下,Mamp Pro提供的mysql命令行工具不可用。您可以通过在终端中键入命令'mysql'来轻松测试。你的输出可能是-bash:mysql:command not found。

为了解决这个问题,做在终端执行以下操作:

sudo vim ~/.bash_profile 

按i 移到最后一行,并附加

export PATH=/Applications/MAMP/Library/bin/:$PATH 

命中逃避:wq 类型(包括结肠),以写入文件并退出vim。 刷新您的档案资源运行源代码~/.bash_profile

mysql命令AND drush现在应该可以工作!

+0

嗯,但它似乎你使用的是Mac OS,但我在Linux和我使用Xamp。希望你提供的理由是完美的,但我需要linux的xamp的解决方案 – Ron 2014-08-29 14:06:12

+0

你确定你正在执行项目根目录下的drush命令吗? – Djouuuuh 2014-08-29 14:20:06

+0

我想通了我tthink我写的命令是不正确的“drush en -y modulename”,但是当我试图drush en modulename -y它工作。 – Ron 2014-08-29 14:26:09