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

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

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

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

Ruby

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

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

GitHub

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

Q&A

解決済

3回答

1472閲覧

atomで編集したものがherokuで反映されない

amazon_106

総合スコア50

Ruby on Rails 5

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

Ruby

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

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

GitHub

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

0グッド

1クリップ

投稿2019/01/15 14:29

編集2019/01/15 17:18

前提・実現したいこと

herokuで公開したアプリケーションに手を加えたいです。
atomでHTMLを編集後、herokuを開いても変更が反映されていませんでした。

atomでHTMLを変更 $git diffを参考に $ git add 変更されたhtml.erb $ git commit -m "変更してみたよ" $ git push heroku master

この後のgitはこんな感じです。
イメージ説明

$ heroku run rails db:migrate $ heroku open

Mac 10.13.6

イメージ説明

イメージ説明

ど素人ですが、知恵をお貸しください!お願いします!

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

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

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

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

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

guest

回答3

0

どのような「編集」を行いましたか。

例えば、

<%= @foo %>

<%= @bar %>

のような「編集」のことです。

投稿2019/01/15 17:13

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

amazon_106

2019/01/15 17:16

<div class="col pl-0"> <%= f.text_field :caption, class: "form-control border-0", placeholder: "コメントおおおおおを書く" %> </div> こんな感じです。
amazon_106

2019/01/15 17:17

元は <div class="col pl-0"> <%= f.text_field :caption, class: "form-control border-0", placeholder: "コメントを書く" %> </div> でした。
退会済みユーザー

退会済みユーザー

2019/01/15 17:17

その「編集」をした後に、「保存」をしましたか。
amazon_106

2019/01/15 17:18

特に意味はなく、実験的にやりました。質問にスクショを載せておきますが、最初にやった変更は、反映されました。
退会済みユーザー

退会済みユーザー

2019/01/15 17:18

その「編集」をした後に、「保存」をしましたか。
amazon_106

2019/01/15 17:19

atomの方でですよね。 保存しました。
退会済みユーザー

退会済みユーザー

2019/01/15 17:21

その後に $ git status コマンドを実行すると、編集したファイルが staging の候補として表示されましたか。
amazon_106

2019/01/15 17:26

とりあえず、 atomでapp/views/posts/new.html.erbを編集しました。 $git status On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: app/views/posts/new.html.erb no changes added to commit (use "git add" and/or "git commit -a")
退会済みユーザー

退会済みユーザー

2019/01/15 17:30 編集

上記のように確認できたら次のようにコマンドを入力していくと思います。 $ git add . $ git commit -m "コミットメッセージ" この後に、 $ git push heroku master を実行してpushします。pushする前と後とで、ページの見え方が変わることを期待していると思います。 しかし、pushした後も変わっていないということでよいですか。
退会済みユーザー

退会済みユーザー

2019/01/15 17:32

なぜ、「pushした後も変わっていない」ということが判断できたのですか。
amazon_106

2019/01/15 17:36

$ heroku run rails db:migrate をして $ heroku openでwebアプリを開いて、目視で確認しました。
退会済みユーザー

退会済みユーザー

2019/01/15 17:39

「目視で」とありますが、目視で確認できるような内容ですか。
amazon_106

2019/01/15 18:08 編集

はい。たぶん、できる内容だと思います。 それと回答を貰って再度、pushし、heroku openしたら、反映されていました。2回すると1回目が。3回すると2回目が反映されるようです。 原因は不明ですが、とりあえず反映できたので今回は、解決にしますね。10tm84さん、長い間お付き合い頂きありがとうございました。
guest

0

HTMLを編集後、herokuを開いても変更が反映されていませんでした。

どのような「編集」を行い、どのように「変更が反映されていない」ことを確認しましたか。

投稿2019/01/15 16:50

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

amazon_106

2019/01/15 16:57 編集

はい。git diffで変更を確認しました。 HTMLですので、見た目から変更されてないことを確認しました。
退会済みユーザー

退会済みユーザー

2019/01/15 16:57

git diff で変更されていないならば、コミットできていないのではないでしょうか。
amazon_106

2019/01/15 17:11

今、再度、atomを編集し、 $git add .した後、 $git commit -m "編集” $ git push heroku master をして、githubで出来ていることを確認した後、 $ heroku run rails db:migrate $ heroku openをしたら、前回の編集したものが、反映されてました。 2回、$ heroku run rails db:migrate $ heroku openをしたら、反映されるのかと思い、やってみましたが、出来ていませんでした。
guest

0

ベストアンサー

$ git push heroku master

このコマンドを実行した後のログを載せて下さい。

投稿2019/01/15 15:11

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

amazon_106

2019/01/15 15:16 編集

めちゃくちゃ長いですが、よろしくお願いします! git push heroku master Counting objects: 12, done. Delta compression using up to 4 threads. Compressing objects: 100% (12/12), done. Writing objects: 100% (12/12), 1.08 KiB | 554.00 KiB/s, done. Total 12 (delta 9), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.5.1 remote: -----> Installing dependencies using bundler 2.0.1 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. remote: Using rake 12.3.2 remote: Using concurrent-ruby 1.1.4 remote: Using i18n 1.5.1 remote: Using minitest 5.11.3 remote: Using thread_safe 0.3.6 remote: Using tzinfo 1.2.5 remote: Using activesupport 5.2.2 remote: Using builder 3.2.3 remote: Using erubi 1.8.0 remote: Using mini_portile2 2.4.0 remote: Using nokogiri 1.10.0 remote: Using rails-dom-testing 2.0.3 remote: Using crass 1.0.4 remote: Using loofah 2.2.3 remote: Using rails-html-sanitizer 1.0.4 remote: Using actionview 5.2.2 remote: Using rack 2.0.6 remote: Using rack-test 1.1.0 remote: Using actionpack 5.2.2 remote: Using nio4r 2.3.1 remote: Using websocket-extensions 0.1.3 remote: Using websocket-driver 0.7.0 remote: Using actioncable 5.2.2 remote: Using globalid 0.4.2 remote: Using activejob 5.2.2 remote: Using mini_mime 1.0.1 remote: Using mail 2.7.1 remote: Using actionmailer 5.2.2 remote: Using activemodel 5.2.2 remote: Using arel 9.0.0 remote: Using activerecord 5.2.2 remote: Using mimemagic 0.3.3 remote: Using marcel 0.3.3 remote: Using activestorage 5.2.2 remote: Using execjs 2.7.0 remote: Using autoprefixer-rails 9.4.5 remote: Using bcrypt 3.1.12 remote: Using msgpack 1.2.6 remote: Using bootsnap 1.3.2 remote: Using popper_js 1.14.5 remote: Using rb-fsevent 0.10.3 remote: Using ffi 1.10.0 remote: Using rb-inotify 0.10.0 remote: Using sass-listen 4.0.0 remote: Using sass 3.7.3 remote: Using bootstrap 4.1.3 remote: Using bundler 2.0.1 remote: Using mime-types-data 3.2018.0812 remote: Using mime-types 3.2.2 remote: Using carrierwave 1.2.3 remote: Using coffee-script-source 1.12.2 remote: Using coffee-script 2.4.1 remote: Using method_source 0.9.2 remote: Using thor 0.20.3 remote: Using railties 5.2.2 remote: Using coffee-rails 4.2.2 remote: Using orm_adapter 0.5.0 remote: Using responders 2.4.0 remote: Using warden 1.2.8 remote: Using devise 4.5.0 remote: Using font-awesome-rails 4.7.0.4 remote: Using multi_json 1.13.1 remote: Using jbuilder 2.8.0 remote: Using jquery-rails 4.3.3 remote: Using pg 1.1.4 remote: Using puma 3.12.0 remote: Using sprockets 3.7.2 remote: Using sprockets-rails 3.2.1 remote: Using rails 5.2.2 remote: Using rmagick 2.16.0 remote: Using tilt 2.0.9 remote: Using sass-rails 5.0.7 remote: Using turbolinks-source 5.2.0 remote: Using turbolinks 5.2.0 remote: Using uglifier 4.1.20 remote: Bundle complete! 25 Gemfile dependencies, 75 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Bundle completed (0.41s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v8.10.0-linux-x64 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: Yarn executable was not detected in the system. remote: Download Yarn at https://yarnpkg.com/en/docs/install remote: Asset precompilation completed (1.70s) remote: Cleaning assets remote: Running: rake assets:clean remote: -----> Detecting rails configuration remote: remote: ###### WARNING: remote: remote: You set your `config.active_storage.service` to :local in production. remote: If you are uploading files to this app, they will not persist after the app remote: is restarted, on one-off dynos, or if the app has multiple dynos. remote: Heroku applications have an ephemeral file system. To remote: persist uploaded files, please use a service such as S3 and update your Rails remote: configuration. remote: remote: For more information can be found in this article: remote: https://devcenter.heroku.com/articles/active-storage-on-heroku remote: remote: remote: ###### WARNING: remote: remote: We detected that some binary dependencies required to remote: use all the preview features of Active Storage are not remote: present on this system. remote: remote: For more information please see: remote: https://devcenter.heroku.com/articles/active-storage-on-heroku remote: remote: remote: ###### WARNING: remote: remote: No Procfile detected, using the default web server. remote: We recommend explicitly declaring how to boot your server process via a Procfile. remote: https://devcenter.heroku.com/articles/ruby-default-web-server remote: remote: remote: -----> Discovering process types remote: Procfile declares types -> (none) remote: Default types for buildpack -> console, rake, web remote: remote: -----> Compressing... remote: Done: 54.7M remote: -----> Launching... remote: Released v10 remote: https://amazonline.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/amazonline.git 0370bab..c65d12a master -> master
退会済みユーザー

退会済みユーザー

2019/01/15 15:18

Herokuへのpushとdeployは問題ないように見えます。 一つ気になるのが、GitHubにコードがあるようなのですが、これはpush先を2つにしているということでしょうか。
amazon_106

2019/01/15 15:52

>GitHubにコードがあるようですが gitのスクショを見て、そう思ったということでよろしいでしょうか。 そうでしたら、アプリごとpushしたいと思い、git add .とやりました。 あと、実験的に同じアプリをターミナルでコピーして、pushしました。 質問にそのスクショを載せました。
退会済みユーザー

退会済みユーザー

2019/01/15 15:55 編集

すいません、こちらの意味がわかりかねるのですが、「アプリごと」とはどういうことになりますか。 > アプリごとpushしたいと思い、git add .とやりました。
amazon_106

2019/01/15 16:02 編集

わかりにくくてすみません(汗)(汗)(汗) 作ったアプリ丸々、gitに上げたくてという意味です。
amazon_106

2019/01/15 16:02 編集

いくつかサイトを参考にgitにpushしたのですが、ほぼ全てのサイトで例が特定のファイルやフォルダだけだったので、アプリごとgitにあげるのは、当たり前なのかもしれないです。
退会済みユーザー

退会済みユーザー

2019/01/15 16:03 編集

先ほどの回答は本質的でないので無視して下さい。 1. $ git push heroku master を行う前に $ git log を実行して出てくるコミット一覧に、「変更してみたよ」というコミットメッセージが含まれるコミットはありますか。 2. 質問中の $ git add は、 $ git add . の誤りということでよろしいですか。
amazon_106

2019/01/15 16:19

git log commit c65d12a794583e463c5992ea4974758b4af5defb (HEAD -> master, origin/master, heroku/master) Author: 僕の名前 <アドレス@gmail.com> Date: Tue Jan 15 22:50:02 2019 +0900 変更してみたよ 多分これだと思います。 git add は、git add 変更した.html.erbのことです。 その後 git commit -m "変更してみたよ" をしました。
退会済みユーザー

退会済みユーザー

2019/01/15 16:22

> git add は、git add 変更した.html.erbのことです。 つまり、 $ git add という記述は誤りということでよろしいですか。
amazon_106

2019/01/15 16:40 編集

そうです。編集しました。
退会済みユーザー

退会済みユーザー

2019/01/15 16:50

どのような「編集」を行い、どのように「変更が反映されていない」ことを確認しましたか。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問