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

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

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

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

Ruby

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

Heroku

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

Q&A

解決済

3回答

538閲覧

herokuにデプロイしても application errorと表示される

sutarai

総合スコア26

Ruby on Rails 5

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

Ruby

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

Heroku

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

0グッド

0クリップ

投稿2018/07/13 07:25

railsチュートリアルの第三章を勉強しております。
windows cloud9を使ってます。

herokuにデプロイしてもapplication errorと表示されます。
migrateは行っております。
heroku logsではat=error, code=H10, desc="App crashed", status=503の部分が赤字で表示されます。
heroku restart を行うと
Restarting web.1 dyno on ⬢ application_afternoon-mesa-73900... !
▸ Couldn't find that app.
と表示されます。
rails console で見てみると
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/ext/save-history.rb:98:in initialize': Permission denied @ rb_sysopen - /usr/local/rvm/rubies/ruby-2.4.1/.irbrc_history (Errno::EACCES) from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/ext/save-history.rb:98:in open'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/ext/save-history.rb:98:in save_history' from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/ext/save-history.rb:64:in block in extended'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb.rb:433:in block in run' from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb.rb:433:in each'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb.rb:433:in run' from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb.rb:385:in start'
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:62:in start' from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:17:in start'
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:97:in perform' from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from /usr/local/rvm/gems/ruby-2.4.1@global/gems/thor-0.20.0/lib/thor.rb:387:in dispatch'
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command/base.rb:63:in perform' from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/command.rb:44:in invoke'
from /usr/local/rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/commands.rb:16:in <top (required)>' from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in require'
from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in block in require' from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in load_dependency'
from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in require' from /home/ec2-user/environment/sample_app/bin/rails:9:in <top (required)>'
from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in load' from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in block in load'
from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in load_dependency' from /usr/local/rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in load'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require'
from -e:1:in `<main>'
と表示去れます。
はじめの方のErrno::EACCESの部分に原因があるのではないかと思うのですが、解決方法がわかりません。
どなたかお分かりになる方お教え頂ければと思います。

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

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

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

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

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

退会済みユーザー

退会済みユーザー

2018/07/16 04:04

まだ解決してないです?
guest

回答3

0

自己解決

ありがとうございました。
どうしても原因がわからなかったので、一回ファイルを元から削除して、railsチュートリアルの3章の始めからやり直しました。
順番が悪かったのか、今回は正しい順序で行うと問題なくherokuに反映されました。
お答え頂き、お手数お掛け致しました。ありがとうございました。

投稿2018/07/17 13:02

sutarai

総合スコア26

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

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

0

追記になります。
すみません、rails db:migrateを行っていたんですが、dbにmigrateのファイルがありませんでした。
何か不足してて、コードが反映されていないと思うんですが、migrateする前には、$ rails generate scaffold User name:string email:string というこのコードを入力してscaffoldを入れておかないとmigrate出来ないんでしょうか?

投稿2018/07/14 01:59

sutarai

総合スコア26

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

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

0

追記になります。
git push heroku を行うと途中に黄色の文字で warningを記述されます。
これは今までなかったと思うので、ここにも原因の理由があるのかもしれません。そのコードを載せておきます。

git push heroku master
Counting objects: 7, done.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 604 bytes | 604.00 KiB/s, done.
Total 7 (delta 5), 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.4.4
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running gem install bundler.
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Using rake 12.3.1
remote: Using concurrent-ruby 1.0.5
remote: Using minitest 5.11.3
remote: Using thread_safe 0.3.6
remote: Using builder 3.2.3
remote: Using erubi 1.7.1
remote: Using mini_portile2 2.3.0
remote: Using crass 1.0.4
remote: Using rack 2.0.5
remote: Using nio4r 2.3.1
remote: Using websocket-extensions 0.1.3
remote: Using mini_mime 1.0.0
remote: Using arel 8.0.0
remote: Using bundler 1.15.2
remote: Using coffee-script-source 1.12.2
remote: Using execjs 2.7.0
remote: Using method_source 0.9.0
remote: Using thor 0.20.0
remote: Using ffi 1.9.25
remote: Using multi_json 1.13.1
remote: Using pg 0.20.0
remote: Using puma 3.9.1
remote: Using rb-fsevent 0.10.3
remote: Using tilt 2.0.8
remote: Using turbolinks-source 5.1.0
remote: Using tzinfo 1.2.5
remote: Using nokogiri 1.8.4
remote: Using i18n 0.9.5
remote: Using websocket-driver 0.6.5
remote: Using mail 2.7.0
remote: Using rack-test 1.0.0
remote: Using sprockets 3.7.2
remote: Using uglifier 3.2.0
remote: Using coffee-script 2.4.1
remote: Using rb-inotify 0.9.10
remote: Using turbolinks 5.0.1
remote: Using loofah 2.2.2
remote: Using activesupport 5.1.4
remote: Using sass-listen 4.0.0
remote: Using rails-html-sanitizer 1.0.4
remote: Using rails-dom-testing 2.0.3
remote: Using globalid 0.4.1
remote: Using activemodel 5.1.4
remote: Using jbuilder 2.7.0
remote: Using sass 3.5.6
remote: Using actionview 5.1.4
remote: Using activerecord 5.1.4
remote: Using activejob 5.1.4
remote: Using actionpack 5.1.4
remote: Using actioncable 5.1.4
remote: Using actionmailer 5.1.4
remote: Using railties 5.1.4
remote: Using sprockets-rails 3.2.1
remote: Using coffee-rails 4.2.2
remote: Using jquery-rails 4.3.1
remote: Using sass-rails 5.0.6
remote: Using rails 5.1.4
remote: Bundle complete! 20 Gemfile dependencies, 57 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 (3.09s)
remote: Cleaning up the bundler cache.
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running gem install bundler.
remote: The latest bundler is 1.16.2, but you are currently running 1.15.2.
remote: To update, run gem install bundler
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.64s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote: -----> Detecting rails configuration
remote:
remote: ###### WARNING:
remote:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.4.4'
remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote: ###### WARNING:
remote:
remote: Detecting rails configuration failed
remote: set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
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, worker
remote:
remote: -----> Compressing...
remote: Done: 32.9M
remote: -----> Launching...
remote: Released v8
remote: https://afternoon-mesa-73900.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/afternoon-mesa-73900.git
62b1c1b..fd72a04 master -> master

投稿2018/07/13 07:53

sutarai

総合スコア26

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問