質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Q&A

解決済

1回答

6589閲覧

laravelのherokuへのpushエラーに困っています。

kohya_suzuki

総合スコア24

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

0グッド

0クリップ

投稿2019/02/20 13:22

初心者です。
vscodeにてウェブサイトをつくろうとしています。
開発環境を整えるためにgitとhorokuを接続し、herokuへのpushを試みたのですがこんなエラーが出ており、困っています。
言語はphp/laravelです。

・エラーコード

PS C:\users\kouya\laravelapp> git push heroku master Enumerating objects: 123, done. Counting objects: 100% (123/123), done. Delta compression using up to 4 threads Compressing objects: 100% (104/104), done. Writing objects: 100% (123/123), 247.07 KiB | 2.35 MiB/s, done. Total 123 (delta 9), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> PHP app detected remote: -----> Bootstrapping... remote: -----> Installing platform packages... remote: - php (7.3.2) remote: - ext-mbstring (bundled with php) remote: - nginx (1.8.1) remote: - apache (2.4.38) remote: -----> Installing dependencies... remote: Composer version 1.8.3 2019-01-30 08:31:33 remote: Loading composer repositories with package information remote: Installing dependencies from lock file remote: Package operations: 53 installs, 0 updates, 0 removals remote: - Installing doctrine/inflector (v1.3.0): Downloading (100%) remote: - Installing doctrine/lexer (v1.0.1): Downloading (100%) remote: - Installing dragonmantank/cron-expression (v2.2.0): Downloading (100%) remote: - Installing erusev/parsedown (1.7.1): Downloading (100%) remote: - Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%) remote: - Installing vlucas/phpdotenv (v2.6.1): Downloading (100%) remote: - Installing symfony/css-selector (v4.2.3): Downloading (100%) remote: - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Downloading (100%) remote: - Installing symfony/polyfill-php72 (v1.10.0): Downloading (100%) remote: - Installing symfony/polyfill-mbstring (v1.10.0): Downloading (100%) remote: - Installing symfony/var-dumper (v4.2.3): Downloading (100%) remote: - Installing symfony/routing (v4.2.3): Downloading (100%) remote: - Installing symfony/process (v4.2.3): Downloading (100%) remote: - Installing symfony/http-foundation (v4.2.3): Downloading (100%) remote: - Installing symfony/contracts (v1.0.2): Downloading (100%) remote: - Installing symfony/event-dispatcher (v4.2.3): Downloading (100%) remote: - Installing psr/log (1.1.0): Downloading (100%) remote: - Installing symfony/debug (v4.2.3): Downloading (100%) remote: - Installing symfony/http-kernel (v4.2.3): Downloading (100%) remote: - Installing symfony/finder (v4.2.3): Downloading (100%) remote: - Installing symfony/console (v4.2.3): Downloading (100%) remote: - Installing egulias/email-validator (2.1.7): Downloading (100%) remote: - Installing swiftmailer/swiftmailer (v6.1.3): Downloading (100%) remote: - Installing paragonie/random_compat (v9.99.99): Downloading (100%) remote: - Installing ramsey/uuid (3.8.0): Downloading (100%) remote: - Installing psr/simple-cache (1.0.1): Downloading (100%) remote: - Installing psr/container (1.0.0): Downloading (100%) remote: - Installing opis/closure (3.1.5): Downloading (100%) remote: - Installing symfony/translation (v4.2.3): Downloading (100%) remote: - Installing nesbot/carbon (1.36.2): Downloading (100%) remote: - Installing monolog/monolog (1.24.0): Downloading (100%) remote: - Installing league/flysystem (1.0.50): Downloading (100%) remote: - Installing ralouphie/getallheaders (2.0.5): Downloading (100%) remote: - Installing psr/http-message (1.0.1): Downloading (100%) remote: - Installing guzzlehttp/psr7 (1.5.2): Downloading (100%) remote: - Installing guzzlehttp/promises (v1.3.1): Downloading (100%) remote: - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%) remote: - Installing laravel/slack-notification-channel (v1.0.3): Downloading (100%) remote: - Installing zendframework/zend-diactoros (1.8.6): Downloading (100%) remote: - Installing php-http/promise (v1.0.0): Downloading (100%) remote: - Installing php-http/httplug (v1.1.0): Downloading (100%) remote: - Installing php-http/guzzle6-adapter (v1.1.1): Downloading (100%) remote: - Installing lcobucci/jwt (3.2.5): Downloading (100%) remote: - Installing nexmo/client (1.6.2): Downloading (100%) remote: - Installing laravel/nexmo-notification-channel (v1.0.1): Downloading (100%) remote: - Installing laravel/framework (v5.7.26): Downloading (100%) remote: - Installing fideloper/proxy (4.1.0): Downloading (100%) remote: - Installing jakub-onderka/php-console-color (v0.2): Downloading (100%) remote: - Installing nikic/php-parser (v4.2.0): Downloading (100%) remote: - Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%) remote: - Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%) remote: - Installing psy/psysh (v0.9.9): Downloading (100%) remote: - Installing laravel/tinker (v1.0.8): Downloading (100%) remote: Generating optimized autoload files remote: > Illuminate\Foundation\ComposerScripts::postAutoloadDump remote: > @php artisan package:discover --ansi remote: remote: In web.php line 17: remote: remote: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ remote: (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) remote: remote: remote: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 remote: ! WARNING: A post-autoload-dump script terminated with an error remote: remote: ! ERROR: Dependency installation failed! remote: ! remote: ! The 'composer install' process failed with an error. The cause remote: ! may be the download or installation of packages, or a pre- or remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts') remote: ! in your 'composer.json'. remote: ! remote: ! Typical error cases are out-of-date or missing parts of code, remote: ! timeouts when making external connections, or memory limits. remote: ! remote: ! Check the above error output closely to determine the cause of remote: ! the problem, ensure the code you're pushing is functioning remote: ! properly, and that all local changes are committed correctly. remote: ! remote: ! For more information on builds for PHP on Heroku, refer to remote: ! https://devcenter.heroku.com/articles/php-support remote: ! remote: ! REMINDER: the following warnings were emitted during the build; remote: ! check the details above, as they may be related to this error: remote: ! - A post-autoload-dump script terminated with an error remote: remote: ! Push rejected, failed to compile PHP app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to clonetwitter1. remote: To https://git.heroku.com/clonetwitter1.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/clonetwitter1.git'

・web.phpの中身

1<?php 2 3/* 4|-------------------------------------------------------------------------- 5| Web Routes 6|-------------------------------------------------------------------------- 7| 8| Here is where you can register web routes for your application. These 9| routes are loaded by the RouteServiceProvider within a group which 10| contains the "web" middleware group. Now create something great! 11| 12*/ 13 14Route::get('foo', function () { 15 return "foo!(); 16 }); 17

・質問
In web.php line 17がsyntax errorと言われていますが、17行目は空欄で直せないため、自分の解釈ができてないように思います。
また、composer.jsonのインストールも指摘されていますが、指摘内容がよくわからず、対処できません。
ご回答よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

return "foo!();

閉じダブルクオートがありません。

投稿2019/02/20 13:25

kazto

総合スコア7196

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kohya_suzuki

2019/02/20 13:56

ありがとうございます! 直してpushしたら解決しました。 深刻そうなエラーでも、原因はこんなに簡単なことでしたね。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問