I'm currently working on a few sites in development using Acquia Dev Desktop.

Even the latest version uses Drush v.5.7, and I know that Omega 4 requires v.5.9. I have installed v.5.9 in my root user folder (since upgrading Drush in the Dev Desktop wasn't working). Is there a way to toggle between different versions of Drush? I want to be getting some new projects underway using Omega 4, and my current Drush setup isn't allowing me to create subthemes or do any other Omega-specific tasks via Drush...

Comments

fubhy’s picture

Status: Active » Fixed

Your best bet would be to trick Drush like so:

Add a omega.drush.inc to sites/all/drush and include ../themes/omega/includes/omega.drush.inc from there. ;)

Yes, this should work (it's a site-specific drush.inc file that, due to carrying the same name as "omega" should be able to include the omega.drush.inc and thereby make it available even though your drush version does not support theme-command discovery).

karolus’s picture

Status: Fixed » Active

Thanks for the response--
I did reinstall Acquia Dev Desktop, and did an install of a new Drupal (7.23) site. Went and installed Omega via the GUI (Omega 4, beta 6). Created the omega.drush.inc file, and added the line of code.

Went into Terminal, cleared the Drush cache.

No finding of Omega commands--back to where I was before. (Entering drush version in Terminal indicated v. 5.7)

Is there some step I'm still missing?

fubhy’s picture

No. Please check if the omega.drush.inc in sites/all/drush/omega.drush.inc is actually loaded by drush (just place a "echo 'hello I am being loaded.'" in it.

What you need in the file, normally is just this:


echo 'hello I am being loaded.';

require_once dirname(dirname(__FILE__)) . '/themes/omega/includes/omega.drush.inc';

Note: I am just guessing based on what I know about drush command discovery. It finds all files ending in ".drush.inc" and takes the prefix (omega in this case) as the name for the hooks, etc. that it then invokes to gather the commands. Now, since you name the file omega.drush.inc it will try to invoke the drush hooks in there which should be there since you included omega.drush.inc from the theme folder. So it _SHOULD_ work.

Please report back if this works for you.

Also, I am not really sure if 5.7 even needs this. No idea when this feature (drush theme command discovery) was added. I think 6.0 but I might be wrong.

karolus’s picture

Thanks--
Added your code, and am getting the echo response when checking drush status in Terminal. I also went in, and manually upgraded Drush in DAMP to 5.9, and it appears to be functioning normally. I can use the command drush dl omega -- which works properly. When I use the command drush omega-subtheme, I'm getting this response in Terminal:

Command omega-subtheme needs a higher bootstrap level to run - you   [error]
will need to invoke drush from a more functional Drupal environment
to run this command.
The drush command 'omega-subtheme' could not be executed.            [error]
Drush was not able to start (bootstrap) the Drupal database.

I went ahead and followed the directions, which listed the following:
https://drupal.org/node/1428638

Changing the settings.php file as suggested only listed fatal errors, so I commented all changes back out.

fubhy’s picture

First of all, please use drush omega-wizard instead. And secondly: is the Drupal site already installed? You have to fully install drupal before these commands can work.

karolus’s picture

Thanks--
Running drush omega-wizard produced the same errors as in my post above.

As far as fully installing Drupal--I have a working site running in my local dev environment. Aside from the issues I'm having with Omega, I can't see any other problems... Is there an alternate type of installation you would recommend?

fubhy’s picture

Do other drush commands work? Like... "drush uli" or "drush cc all"?

karolus’s picture

Status: Closed (cannot reproduce) » Active

drush cc all works fine, but drush uli gives the same error. Is there another setting in .bashrc I should change, or something else?

Also, drush status and which drush indicate all is fine.

I had reinstalled Acquia DAMP yesterday, and upgraded the drush version in that build to 5.9. Had even set up another environment in MAMP. Is there another avenue you would suggest?

fubhy’s picture

Status: Active » Closed (cannot reproduce)

Yep. So that means this is absolutely not related to the Drush version or Omega in any way and rather means that there is something wrong with your setup. I'd suggest you file this as a support request in the Drush issue queue instead. I can't really provide more help on this as it's not related to Omega and I don't have the time to look that deeply into Drush to debug it right now. Sorry.

karolus’s picture

Status: Active » Closed (cannot reproduce)

Thank you--will do...

karolus’s picture

Status: Closed (cannot reproduce) » Closed (fixed)

OK--
Did a lot of research (mainly trial-and-error) and was plenty frustrating, but:

I uninstalled and reinstalled all necessary apps (Acquia DAMP, MAMP, PEAR, Drush {even upgraded to the 6.x dev}). Going through all instruction steps still indicated the same issues, where drush status would often indicate a bootstrap issue. Knowing that a DB issue would affect more than just Omega work, I tested for other DB issues. I tried a number of different settings for the drush configs in my system root folder and in /sites/settings.php, as well. Nothing worked here. Also discussed it with other devs at a drupal event last night, and more late searching.

Back to square one, though, this morning--with a fresh install of a new Drupal 7.23 core into Acquia DAMP. Checked over the site files after setup (keeping in mind the issue was related to DB). In the Acquia install, there is a [your sitename].locahost folder created with its own settings.php file with auto-generated values. All I did was copy this settings.php file to the sites/default folder. Ran drush cc drush, then navigated to the site in Terminal. Running drush omega-wizard worked without a hitch, then. To be sure, I created another site, and repeated the same process--all fine.

From what I could tell, the issue stemmed from Drush/Omega looking for the site and DB settings in the sites/default folder, while the Acquia DAMP Drupal install could work fine by referencing these settings from [your sitename].locahost folder it created...