ddev のガイドを見る限り、次のコマンド類でローカルにサイトが立ち上がるはずだった。
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer create drupal/recommended-project:^11
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev launch
# or automatically log in with
ddev launch $(ddev drush uli)
しかし、私の日頃の行いが悪いのか、ddev composer create
の箇所でどうしてもエラーが出てしまう。
me: demo-11 % ddev composer create drupal/recommended-project drupal
Failed to create project: '/Users/me/drupal/demo/demo-11/.DS_Store' is not allowed to be present. composer create needs to be run on a clean/empty project with only the following paths: [web web/sites web/sites/default web/sites/default/.gitignore web/sites/default/files web/sites/default/files/sync web/sites/default/settings.ddev.php web/sites/default/settings.php] - please clean up the project before using 'ddev composer create'
見ているとmacが勝手に作ってしまう .DS_Store
が邪魔しているようにも見える。
ddev のガイドで ddev composer のあたりの↓の記述がかなり厳密なように思われる。
When using
ddev composer create
your project should be essentially empty or the command will refuse to run, to avoid loss of your files.
調べているうちに、この .DS_Store
に関連して
最近のDrupalCMSインストール時に使う ./launch-drupal-cms.sh
について扱ったIssueが引っかかった。
Make the DDEV launcher script more relaxed and fault-tolerant
It looks the installer finds a .DS_Store file (typical of Mac OS X) that I even cannot see and find in the drupal-cms folder, also as invisible file.
やはり .DS_Store が悪者とみて良さそう。
そしてIssueには更に
When you look at a folder in Finder, it puts a .DS_Store in there, and DDEV freaks out because the directory is, as far as it's concerned, not empty.
The workaround for you is to not open the directory in Finder, and do this in Terminal:
ようは Finder でフォルダを開きながら作業すると .DS_Store が勝手にできてしまうので、すべてターミナルで作業しろとのこと。
確かに ターミナルで完結させると.DS_Store
はできなかった。
一方で、drupal/recommended-project:^11
はうまく通らなかった。^11
を消してうまく進められた。
% ddev composer create drupal/recommended-project:^11
zsh: no matches found: drupal/recommended-project:^11
% ddev composer create drupal/recommended-project
Executing Composer command: [composer create-project drupal/recommended-project --no-plugins --no-scripts --no-install /tmp/RibuVw]
Creating a "drupal/recommended-project" project at "/tmp/RibuVw"
Installing drupal/recommended-project (11.1.1)
Plugins have been disabled.
- Downloading drupal/recommended-project (11.1.1)
- Installing drupal/recommended-project (11.1.1): Extracting archive
そのため結論は次のとおり。
そしてmacユーザは絶対にFinderを開いては行けない。(鶴の恩返しみたいだが、覗いてはいけない)
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer create drupal/recommended-project
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev launch
# or automatically log in with
ddev launch $(ddev drush uli)
- コメントを投稿するにはログインしてください