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

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

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

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

Heroku

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

Q&A

2回答

2596閲覧

bash: rails: command not found と出てしまいます・・・

minminzemi

総合スコア12

Ruby on Rails 5

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

Heroku

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

0グッド

0クリップ

投稿2018/11/18 13:55

前提・実現したいこと

rails5で作ったものをHerokuにデプロイしたいです!

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

heroku run rails db:migrateをすると、

Running rails db:migrate on ⬢ bookchange-090... up, run.8258 (Free) bash: rails: command not found

というエラーが出てしまいます。

Gemfie , database.yml

Gemfie

group :production do gem 'pg', '0.21.0' end

database.yml

production: adapter: postgresql encoding: unicode pool: 5 database: message-board_production username: message-board password: <%= ENV['MESSAGE-BOARD_DATABASE_PASSWORD'] %>

のようになっています。

試したこと

git push heroku master をすると、

Counting objects: 228, done. Compressing objects: 100% (202/202), done. Writing objects: 100% (228/228), 678.53 KiB | 11.90 MiB/s, done. Total 228 (delta 70), 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.5 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.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote: updated Gemfile.lock to version control. remote: remote: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * pg (= 0.21.0) remote: remote: You have deleted from the Gemfile: remote: * pg (= 0.20.0) remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote: updated Gemfile.lock to version control. remote: remote: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * pg (= 0.21.0) remote: remote: You have deleted from the Gemfile: remote: * pg (= 0.20.0) remote: remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to bookchange-090. remote: To https://git.heroku.com/bookchange-090.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/bookchange-090.git'

と出てしまいます。

どなたかお詳しい方、ぜひご教授ください!

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

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

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

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

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

guest

回答2

0

ローカル環境のbundlerが古いようです。
gem install bundlerでアップデートをしてみてはいかがでしょうか。

herokuでPostgreSQLを使用するには、addonが必要なようです。

https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres

上記対応は行いましたでしょうか。

投稿2018/12/26 07:49

kazto

総合スコア7196

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

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

0

私も全く同様のエラーが表示されているのですが、どのように解決しましたか??

回答ではなくて、すみません!!

投稿2018/12/26 07:31

編集2018/12/26 07:32
ko-u

総合スコア61

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問