2014-08-28 204 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