LoginSignup
0
0

More than 1 year has passed since last update.

git reset --hardをして訳のわからないことになった。

Posted at

git reset --hardをして失敗

初心者の知識ではわからないぐらい何かおかしいことが起きた。
怖い。
マイグレーションファイルは消えてしまうし、ステータスも知ることができない。

*********@mbp garden % rails db:migarate status
/Users/************/*******/******/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)
        from /Users/************/*******/******/config/boot.rb:4:in `<top (required)>'
        from bin/rails:3:in `require_relative'
        from bin/rails:3:in `<main>'

`require': cannot load such file -- bootsnap/setup (LoadError)で検索

@nicolasmlv you are using bootsnap (0.2.12) which did not include this file. We are now on bootsnap 1.1.2 (After jumping from 0.3.x which introduced bootsnap/setup).

Please run bundle update bootsnap :)

何いっているかわからないが、bundle update bootsnapを行った。

*********@mbp garden % bundle update bootsnap
Could not find gem 'bootsnap'.

どうやらgem 'bootsnap'が必要らしい

gem "bootsnap", require: false

もう一回bundle update bootsnapを行った。

*********::@mbp garden % bundle update bootsnap
Fetching gem metadata from https://rubygems.org/..........
.
.
.
An error occurred while installing msgpack (1.6.1), and Bundler cannot continue.
.
.
.
An error occurred while installing msgpack (1.6.1), and Bundler cannot continue.

In Gemfile:
  bootsnap was resolved to 1.16.0, which depends on
    msgpack

ダメだった。
行が多すぎて見落としているところもあるかもしれない。
困った。

最後にrails db:migrateを行った。

**********@mbp garden % rails db:migrate                               
Could not find gem 'bootsnap (~> 1.16.0)' in locally installed gems.

The source contains the following gems matching 'bootsnap':
  * bootsnap-1.4.5
  * bootsnap-1.11.1
Run `bundle install` to install missing gems
.
.
.
An error occurred while installing msgpack (1.6.1), and Bundler cannot continue.

In Gemfile:
  bootsnap was resolved to 1.16.0, which depends on
    msgpack

解決しそうな文言発見

* bootsnap-1.4.5
  * bootsnap-1.11.1
Run `bundle install` to install missing gems

どれかわからないがとりあえずbootsnap-1.11.1を使って検索

gem 'bootsnap', '~> 1.11', '>= 1.11.1'

出典

解決

migrateとstatusはできるようになった。
しかし
これからまたエラーが出るだろう。
パニックになった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0