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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

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

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

1528閲覧

herokuデプロイ時, SaasのSyntaxErrorでPrecompiling assets failedが起こる問題

Romay

総合スコア40

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

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

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2019/04/01 00:58

編集2019/04/01 23:06

前提・実現したいこと

Railsアプリ製作中
Ruby 3.4.5
Rails 4.2.8
postgresql(heroku本番環境)
mysql(開発環境)

herokuへのデプロイは何回か成功済み。

本番環境でログアウトできない問題が起きたので、こちらの通りに進めていたところでエラーが起きました。

Heroku + Rails4.2 + Devise + Bootstrap3系列で本番環境でログアウト(Sign_out)ができない問題

command

1rm -rf public/assets

でpublic/assetsを消し、

command

1git push heroku master

の操作後にエラーになりました。

発生している問題・エラーメッセージ

以下エラー文該当箇所抜粋

terminal

1rake aborted! 2remote: Sass::SyntaxError: Invalid CSS after "}": expected selector or at-rule, was "}" 3remote: (in /tmp/build_8ccc38899945b5393cd905fa5ea4197a/app/assets/stylesheets/application.scss) 4remote: (sass):14102

Invalidの "}" とexpected が "}"で全く一緒でエラー文が参考になりません。
全角スペースなどの可能性もありますが、sublimeで見つけられるようにしているのでこの可能性は低いように思います。

該当のソースコード

command

1rm -rf public/assets

でpublic/assetsを消し、

command

1git push heroku master

の操作後にエラーになりました。

以下追記しました

assets/stylesheets/application.scss

ruby

1/* 2 * This is a manifest file that'll be compiled into application.css, which will include all the files 3 * listed below. 4 * 5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 * 8 * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 * compiled file so the styles you add here take precedence over styles defined in any styles 10 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 * file per style scope. 12 * 13 *= require_self 14 *= require bootstrap-theme.css 15 *= require bootstrap-theme.css.map 16 *= require bootstrap-theme.min.css 17 *= require bootstrap.css 18 *= require bootstrap.css.map 19 *= require bootstrap.min.css 20 *= require main.css 21 *= require responsive.css 22 *= require profilecard.scss 23 *= require font-awesome 24 *= require linkmodal 25 *= require jquery.kenburnsy.css 26 27 *= require top.scss 28 *= require users.scss 29 *= require sign-up.css 30 */ 31 32@import "bootstrap-sprockets"; 33@import "bootstrap";

以下追記 Rakefileです。

ruby

1# Add your own tasks in files placed in lib/tasks ending in .rake, 2# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 4require File.expand_path('../config/application', __FILE__) 5 6Rails.application.load_tasks 7

試したこと

public/assetsを消しただけで、CSSはいじっていない(気づかずにタイプしている可能性はあるが)ので何が原因なのかわかりません。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

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

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

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

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

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

kazto

2019/04/01 05:11

assets/stylesheets/application.scss の内容を質問に追記してください。
Romay

2019/04/01 17:51

コメントありがとうございます。追記いたしました。
kazto

2019/04/01 22:44

application.scss自体の内容に不備は無さそうです。これは、scssが意図どおりにビルドできていない可能性があります。 次は、Rakefileの内容を追記お願いします。
Romay

2019/04/01 23:06

コメントありがとうございます。 Rakefile、存在を初めて知りましたが追記いたしました。
guest

回答1

0

自己解決

Gitでrollback処理し、エラー発生前まで戻るという処理を選択しました。
根本的な解決になっておりませんが、開発の関係上この手段を取りました。

投稿2019/04/07 06:27

Romay

総合スコア40

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問