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

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

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

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

Q&A

解決済

1回答

1215閲覧

アセットプリコンパイル

gnx_vw903

総合スコア74

Ruby on Rails 5

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

0グッド

0クリップ

投稿2019/01/03 00:35

アセットプリコンパイルを行おうとしたら以下のエラーが起こってしまいました。

vagrant@ubuntu-xenial:~/workspace/twitter$ rails assets:precompile RAILS_ENV=production bin/rails:2: syntax error, unexpected << <<<<<<< HEAD ^~ bin/rails:8: syntax error, unexpected ===, expecting end-of-input ======= ^~~

###お尋ねしたいこと
エラーの出ているbin/railsは以下のようになっています。

<<<<<<< HEAD begin load File.expand_path('../spring', __FILE__) rescue LoadError => e raise unless e.message.include?('spring') end ======= >>>>>>> 68602dc2b33b5a6d41371e8f38a118e0bc90f0e1 APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands'

大変申し訳ないのですがこれらが何を表しているのか、どこを修正していいのかを
お教えいただきたいです。

よろしくお願いいたします。


おそらくこのファイルのどこかが関連してると思うのですが、
いまいちつかめていない状態です。
(config/environments/production.rb)

Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true # Attempt to read encrypted secrets from `config/secrets.yml.enc`. # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or # `config/secrets.yml.key`. config.read_encrypted_secrets = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Mount Action Cable outside main process or domain # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. config.log_level = :debug # Prepend all log lines with the following tags. config.log_tags = [ :request_id ] # Use a different cache store in production. # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment) # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "sample_#{Rails.env}" config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end

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

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

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

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

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

CHERRY

2019/01/03 01:38

git merge で、コンフリクトしているように見えますが、git をお使いですか?
gnx_vw903

2019/01/03 01:43

回答ありがとうございます。 使っております。 mergeがうまくいっていないのですかね?
退会済みユーザー

退会済みユーザー

2019/01/03 08:23

うまくいってないというより、機械的判断ができないから目視で確認しろって状態
guest

回答1

0

ベストアンサー

<<<<<<< HEAD
======= >>>>>>> 68602dc2b33b5a6d41371e8f38a118e0bc90f0e1

直接的な原因は上記がRubyの文法としておかしいのでエラーが出ています。
これらを削除するかコメントアウトすれば当座は動作するかと。
そして上記が書き込まれた原因はgitのコンフリクトでしょう。

投稿2019/01/03 08:19

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

gnx_vw903

2019/01/03 12:29

回答ありがとうございます。 git statusをしてみてもコンフリクトが見つからないのですが、 ``` vagrant@ubuntu-xenial:~/workspace/twitter$ git status On branch master Untracked files: (use "git add <file>..." to include in what will be committed) Twitter/ nothing added to commit but untracked files present (use "git add" to track) ``` コンフリクトの見つけ方間違っているでしょうか?
退会済みユーザー

退会済みユーザー

2019/01/03 15:32

コンフリクトすると今回のような目印がgitに書き込まれます。 コンフリクトの解消方法はGoogleで調べて下さい。
gnx_vw903

2019/01/04 11:31

回答ありがとうございます。 コンフリクト調べてみます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問