0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【迷子】docker mysql InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 704 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!

Posted at

やりたいこと

  • railsを動かしたく、エラーを解決したい

エラー内容

  • エラー1
docker mysql  InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 704 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!

./ibdata1を消す

  • エラー2
[ERROR] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation

イメージ消して再ビルド, docker compose up

  • エラー3
/usr/local/bundle/gems/activesupport-7.0.4.3/lib/active_support/message_encryptor.rb:209:in `rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)

decryptがなんか言っとる

調査

調査の前に、バージョンを整理する

  • ruby:3.2.2
  • Rails: 7.0.4.3
  • mysql2: 0.5
  • docker desktop(win): 20

https://stackoverflow.com/questions/58527015/activesupportmessageencryptorinvalidmessage-activesupportmessageencrypto

  1. remove this file:
$ rm config/credentials.yml.enc
  1. re-generate this file:
$ EDITOR="vim" bundle exec rails credentials:edit

then try again

https://github.com/rails/rails/issues/31397

credentials.yml.encはrais newの時にのみmaster.keyとセットで作られるのかな?

ターミナルでこのコマンド打とうとするが打てない

$ EDITOR="vim" bundle exec rails credentials:edit

原因

  • credentials.yml.encを一度削除したので整合性が取れなくなった?

https://qiita.com/NaokiIshimura/items/2a179f2ab910992c4d39

解決策

  • 0から作り直す

最後の手段

  • dockerのコンテナでrailsコマンドを打ってcredentialsの編集を試みる

再度config/credentials.yml.encを削除する

winでは以下のコマンドを打つと良さそう

> $env:EDITOR="code --wait"
> rails credentials:edit

https://stackoverflow.com/questions/57402435/how-to-run-rails-credentialsedit-on-windows-10-without-installing-a-linux-sub

エラー1

Could not find mysql2-0.5.5 in locally installed gems
Run `bundle install --gemfile C:/Users/kr117/Desktop/myapp3/Gemfile` to install missing gems.

似た話題がissueに上がってる

https://github.com/brianmario/mysql2/issues/1210

gem install mysql2 --platform=ruby -- --with-mysql-dir=c:/Ruby32/msys32/mingw32

打ってみた

もうあるよと言ってる

Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mysql2-0.5.5 for inspection.

bundle install

失敗

mkmf.logに書いてあるというので見る

それっぽいエラーはあったが

error: 'rb_wait_for_single_fd' undeclared (first use in this function)

一旦最後の手段を取ることにした。

理解が追い付いたら加筆する。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?