過去に作成した main.less というファイルがあります。不要になったので削除しましたが、実行しようとすると次のエラーが表示されますbin/console assetic:watch
[error] The source file "/home/distribution/public_html/distribution.tech/app/../web/bundles/app/less/main.less" does not exist.
またはbin/console assetic:dump
使用環境に関係なく。
[RuntimeException]
The source file "/home/distribution/public_html/distribution.tech/app/../web/bundles/app/less/main.less" does not exist.
これを行うまで機能していた現在のルーチンは、次のコマンドを実行するシェル スクリプト ファイルを作成することでした。
chown -R distribution:distribution .
rm -rf var/cache/dev/*
rm -rf var/cache/prod/*
rm -rf web/css/*
rm -rf web/js/*
bin/console cache:clear --env=dev
bin/console cache:clear --env=prod --no-debug
bin/console assets:install web --symlink --relative
bin/console assetic:dump --env=dev --verbose
bin/console assetic:dump --env=prod --no-debug
bin/console assetic:watch
bin/console doctrine:schema:update --force --dump-sql
bin/console doctrine:schema:update --force --dump-sql --env=prod
chown -R distribution:distribution .
bin/console server:run
すべてが機能することを確認するために、常にルートとして実行しますが、ファイルはユーザー配布によって所有されます。
less および javascript ファイルを参照する唯一のファイルは...
base.html.twig
{% spaceless %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
{% stylesheets 'bundles/skeleton/less/main.less' filter='less' filter='uglifycss' filter='cssrewrite' output='css/compiled-main.css' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}
{% javascripts
'@SkeletonBundle/Resources/public/js/*'
'@AppBundle/Resources/public/js/*'
filter='uglifyjs2'
output='js/js-compiled.js'
%}
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="{{ asset_url }}"</script>
{% endjavascripts %}
{% endblock %}
</body>
</html>
{% endspaceless %}
私のディレクトリ構造は、FTPから直接以下のようになります
main.less が app バンドルではなくスケルトン バンドルになっていることがわかります。ここに移動しましたが、何らかの理由で、スケルトン バンドルではなく、まだアプリ バンドルにあると思われますか??
このエラーを修正するにはどうすればよいですか?
追加情報:
エラーの詳細なトレースを実行すると、asset:dump でこれが得られました
Dumping all dev assets.
Debug mode is on.
03:37:43 [file+] /home/distribution/public_html/distribution.tech/app/../web/css/compiled-main.css
/home/distribution/public_html/distribution.tech/app/../web/bundles/skeleton/less/main.less
03:37:43 [file+] /home/distribution/public_html/distribution.tech/app/../web/css/compiled-main_main_1.css
/home/distribution/public_html/distribution.tech/app/../web/bundles/skeleton/less/main.less
03:37:44 [file+] /home/distribution/public_html/distribution.tech/app/../web/js/js-compiled.js
/home/distribution/public_html/distribution.tech/src/SkeletonBundle/Resources/public/js/shared.js
/home/distribution/public_html/distribution.tech/src/AppBundle/Resources/public/js/app.js
03:37:44 [file+] /home/distribution/public_html/distribution.tech/app/../web/js/js-compiled_part_1_shared_1.js
/home/distribution/public_html/distribution.tech/src/SkeletonBundle/Resources/public/js/shared.js
03:37:45 [file+] /home/distribution/public_html/distribution.tech/app/../web/js/js-compiled_part_2_app_1.js
/home/distribution/public_html/distribution.tech/src/AppBundle/Resources/public/js/app.js
03:37:45 [file+] /home/distribution/public_html/distribution.tech/app/../web/css/compiled-main.css
/home/distribution/public_html/distribution.tech/app/../web/bundles/app/less/main.less
[RuntimeException]
The source file "/home/distribution/public_html/distribution.tech/app/../web/bundles/app/less/main.less" does not exist.
Exception trace:
() at /home/distribution/public_html/distribution.tech/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php:62
Assetic\Asset\FileAsset->load() at /home/distribution/public_html/distribution.tech/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php:103
Assetic\Asset\BaseAsset->dump() at /home/distribution/public_html/distribution.tech/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php:151
Assetic\Asset\AssetCollection->dump() at /home/distribution/public_html/distribution.tech/vendor/symfony/assetic-bundle/Command/AbstractCommand.php:119
Symfony\Bundle\AsseticBundle\Command\AbstractCommand->doDump() at /home/distribution/public_html/distribution.tech/vendor/symfony/assetic-bundle/Command/AbstractCommand.php:51
Symfony\Bundle\AsseticBundle\Command\AbstractCommand->dumpAsset() at /home/distribution/public_html/distribution.tech/vendor/symfony/assetic-bundle/Command/DumpCommand.php:118
Symfony\Bundle\AsseticBundle\Command\DumpCommand->execute() at /home/distribution/public_html/distribution.tech/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /home/distribution/public_html/distribution.tech/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:803
Symfony\Component\Console\Application->doRunCommand() at /home/distribution/public_html/distribution.tech/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:186
Symfony\Component\Console\Application->doRun() at /home/distribution/public_html/distribution.tech/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/distribution/public_html/distribution.tech/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:117
Symfony\Component\Console\Application->run() at /home/distribution/public_html/distribution.tech/bin/console:29
assetic:dump [--forks FORKS] [--watch] [--force] [--period PERIOD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<write_to>]
Config.yml アセット設定:
assetic:
debug: '%kernel.debug%'
use_controller: '%kernel.debug%'
filters:
cssrewrite: ~
uglifyjs2:
# the path to the uglifyjs executable
bin: /usr/bin/uglifyjs
uglifycss:
bin: /usr/bin/uglifycss
less:
node_paths: [/usr/local/lib/node_modules/]
bin: /usr/bin/less
スケルトン バンドルの Main.less
/* Global Variables */
@logo: "../images/logo-hires-opt.png";
/* Fonts */
@font-face {
font-family: 'ProximaNova';
src: url('../fonts/proximanova-regular-webfont.ttf');
}
@font-face {
font-family: 'ProximaNovaAltBold';
src: url('../fonts/proxima_nova_alt_bold-webfont.ttf');
}
.withfont{font-family:ProximaNova;color:blue;background:url('../images/background.jpg');}
@import "shared.less";
@import "header.less";
@import "footer.less";
appBundle の Admin.less ファイル
.test{color:red}
admin.html.twig
{% extends 'SkeletonBundle::base.html.twig' %}
{% block body %}
<div id="wrapper">
<div id="container">
<div class="withfont">admin page</div>
<div>admin page without <span class="test">fonts</span></div>
</div>
</div>
{% endblock %}