Hello everyone,

First off, I am quite new to Drupal and web developing in general.
I am trying here to set up omega on my drupal database so I can get started and edit my own subtheme. I am currently following leveluptuts which are great, but I get stuck at the most interesting point ...! I cant figure why when I am trying to launch the wizard I have this error message coming up:

The drush command 'owiz' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have [error]
installed new extensions.
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database. In this case you can select
another site with a working database setup by specifying the URI to use with the --uri parameter on the command line.
See `drush topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a
jailed shell. See http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
Drupal version : 7.27
Site URI : http://default
Database driver : mysql
Database username : root
Database name : drupal
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush version : 7.0-dev
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /Applications/MAMP/htdocs/drupal
Site path : sites/default

I am using a localhost, MAMP, to develop the website. I imagine I must have left something out in the setting up of drush or omega...
However when typing drush help, omega commands appear in the terminal.

Help would be greatly appreciated, I spent all day stuck there and Im really starting to feel desperate lol.

Thanks a lot :)

Comments

fubhy’s picture

Do other Drush commands work? For example... Can you enable/disable modules without problems? If that's the case, please ensure that Omega is placed in the right directory (sites/all/themes for example). Once that's done, run "drush cc drush", then try again "drush omega-wizard" (or its short-form "drush owiz").

karolus’s picture

One thing I have noticed when running Omega wizard on MacOS is that using the proper case in your Terminal commands is vitally important. For a lot of other tasks done there, it's irrelevant, but not in this case. For example, entering file paths such as user/sites/mysites may get you to the proper area, but if the actual case of the folder names are user/Sites/MySite, you probably will get errors running Omega wizard. Once I figured this out, it was smooth sailing.

fubhy’s picture

Yes, that's actually a good pointer. Didn't we have an issue for that where other people where experiencing that problem?

fubhy’s picture

C13L0’s picture

Drush has an issue connecting to the database in mamp. This has nothing to do with with Omega 4 though it may seem like it because owiz needs to connect to the database to create the subtheme through drush.

You will need to edit the .bash_profile. Your bash_profile will not be identical to mine as you may use a different php version or different paths but hopefully it will get you started in the right direction.

This is what my .bash_profile looks like:

source ~/.bashrc

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*  

export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.5.10/bin:$PATH"

export PATH
export DRUSH_PHP="/Applications/MAMP/bin/php/php5.5.10/bin/php"
export PATH=/usr/local/bin:$PATH

Also close out your terminal and mamp and restart.

barrypoore’s picture

I kept getting that error:

Drush was attempting to connect to:
Drupal version : 7.27
....
....
etc

I'm using mamp and the thing that fixed the issue for me was adding mamp's mysql port number in the db connection in settings.php

'port' => '8889',

as soon as I added that it ran like an athlete :)

DamienMcKenna’s picture

Status: Active » Postponed (maintainer needs more info)

A few things to check:

  • Is Drush using the built-in version of PHP or the one installed from MAMP? You can find out by typing this in the terminal: which php If it says "/usr/bin/php" then you're using the wrong one and need to follow C13L0's info above.
  • Where are your database settings stored? If it's anything other than sites/default/settings.php you'll need to either tell Drush to use a different hostname directory, e.g. if the settings file is located at sites/mysite/settings.php you would give the argument "--uri mysite" or "-l mysite", or you could add a sites/all/drush/drushrc.php file that contained a line $options['uri'] = 'mysite';
steinmb’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.