herokuコマンドを久しぶりに動かせる?
Railsのアプリケーションも久しぶりなんですが、heroku のコマンドを叩くのも久しぶり...。
せっかくアプリをRails5.2にあげてみたので、herokuがわにもちゃんとデプロイしたいなと思って、コマンドを叩いたらエラーになってしまった.....
code:bash
toy_app $ heroku apps
internal/modules/cjs/loader.js:550
throw err;
^
Error: Cannot find module 'tslib'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object.<anonymous> (/Users/akiko/.local/share/heroku/client/node_modules/@cli-engine/engine/lib/cli.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
とりあえずheroku コマンドをアップデート(再インストール)してみます。
code:bash
toy_app $ brew install heroku
Updating Homebrew...
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
.....
なんとかバージョンが上がって利用できるようになったっぽいので、確認。
code:bash
toy_app $ heroku apps
▸ Invalid credentials provided.
heroku: Enter your login credentials
Password: *************
Logged in as akiko.pusu@gmail.com
=== akiko.pusu@gmail.com Apps
akiko-rails-tutorial-hello
glacial-meadow-26113
Heroku側のリポジトリに変更を適用するために push
code:bash
toy_app $ git branch
* master
toy_app $ git push heroku master
Counting objects: 40, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (37/37), done.
Writing objects: 100% (40/40), 7.72 KiB | 202.00 KiB/s, done.
Total 40 (delta 24), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
.......
toy_app $ heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade, see:
=== web (Free): bin/rails server -p $PORT -e $RAILS_ENV (1)
web.1: up 2018/08/26 17:03:53 +0900 (~ 1m ago)
Heroku側のバージョンを確認する
code:bash
toy_app $ heroku run rails about
Running rails about on ⬢ glacial-meadow-26113... up, run.9844 (Free)
D, 2018-08-26T17:06:41.512154 #4 DEBUG -- : (3.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC About your application's environment
Rails version 5.2.1
Ruby version 2.3.4-p301 (x86_64-linux)
RubyGems version 2.5.2.1
Rack version 2.0.5
JavaScript Runtime Node.js (V8)
Middleware Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper
Application root /app
Environment production
Database adapter postgresql
Database schema version 20170613220826
大丈夫でした!
Herokuに関しては、調べ物をしましたので、その結果をQiitaに貼り付けしました。