Answers.Body: <p>Maybe the standard wrong suggestion :-) but did you try the generate:module whilst in a subfolder of your website root?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T11:34:11.363Z
Answers.LastActivityDate: 2015-05-25T11:34:11.363Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>The problem is resolved now, actually when I called civix from var/www/drupal I was getting this exception. Then after installing <a href="https://github.com/civicrm/civicrm-buildkit" rel="nofollow">buildkit</a> and setup of drupal-demo site, I again called civix but this time under the drupal-demo CMS root dir (viz. /opt/buildkit/build/dmaster/sites/all/modules). Now I am successfully able to generate a skeletal extension module.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-16T07:08:14.510Z
Answers.LastActivityDate: 2015-06-16T07:08:14.510Z
Answers.UserDisplayName: Anudit Verma
Body: <p>I was working to create skeletal extension module through civix but unfortunately I am getting this exception "Failed to locate CMS. Please call civix from somewhere under the CMS root."</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-30T08:03:44.980Z
Comments.Text: The error message offers a suggested course of action -- i.e. make sure that the extension folder is located under the CMS root (Drupal/WordPress/Joomla/website root). Before calling ```civix```, make sure to ```cd``` into that folder. If that doesn't work, then update the question to include details about your directory structure and environment. If you use symlinks, hardlinks, or other filesystem tricks, change the file structure to be simpler.
Comments.UserDisplayName: Tim Otten
Tags: <civix><gsoc>
Title: How to get over 'Failed to locate CMS...' exception on civix?
ThreadText: # How to get over 'Failed to locate CMS...' exception on civix?
  
  (Asked by: username_0 on 2015-05-25)
  
  I was working to create skeletal extension module through civix but unfortunately I am getting this exception "Failed to locate CMS. Please call civix from somewhere under the CMS root."
  
  **Tags:** civix, gsoc
  
  > **Comments:**
  > **username_1**: The error message offers a suggested course of action -- i.e. make sure that the extension folder is located under the CMS root (Drupal/WordPress/Joomla/website root). Before calling ```civix```, make sure to ```cd``` into that folder. If that doesn't work, then update the question to include details about your directory structure and environment. If you use symlinks, hardlinks, or other filesystem tricks, change the file structure to be simpler.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-05-25. Score: 1
  
  Maybe the standard wrong suggestion :-) but did you try the generate:module whilst in a subfolder of your website root?
  
  
  ---
  
  ### Answer by username_0 on 2015-06-16. Score: 0
  
  The problem is resolved now, actually when I called civix from var/www/drupal I was getting this exception. Then after installing [buildkit](https://github.com/civicrm/civicrm-buildkit) and setup of drupal-demo site, I again called civix but this time under the drupal-demo CMS root dir (viz. /opt/buildkit/build/dmaster/sites/all/modules). Now I am successfully able to generate a skeletal extension module.
  
  
  ---
  
  