Nguyen Cuc
Nguyen Cuc

Reputation: 97

My error when I setup rails with M1 and ruby 3.1.2?

I am trying to setup Rails and here is my problem.

My ruby version is 3.1.2(when I checked by command ruby -v)

ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]

But when I ran some codes like rails -v or rails -s, it always gave me this error

/Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': incompatible library version - /Users/anhbui/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/bootsnap.bundle (LoadError)
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache/iseq.rb:3:in `<top (required)>'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache.rb:16:in `require_relative'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/compile_cache.rb:16:in `setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap.rb:55:in `setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap.rb:97:in `default_setup'
from /Users/xxx/.gem/ruby/3.1.2/gems/bootsnap-1.14.0/lib/bootsnap/setup.rb:5:in `<top (required)>'
from /Users/xxx/Desktop/Rails/freelancer/config/boot.rb:4:in `require'
from /Users/xxx/Desktop/Rails/freelancer/config/boot.rb:4:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'

So, how can I fix this one ?

My setup is

ruby 3.1.2 yarn 1.22.19 node 19.0.1 rails 6.1.x (maybe)

Thank you in advance!

Upvotes: 0

Views: 108

Answers (1)

Taimoor Hassan
Taimoor Hassan

Reputation: 417

Not sure what is the bug here but I faced the same issue and I solved it by completely uninstalling brew and reinstalling it back.

I got the suggestion from here: https://github.com/Shopify/bootsnap/issues/352

Upvotes: 1

Related Questions