Rails new is throwing an error for msgpack

Viewed 1047

I'm running into an issue with rails new

I have rbenv installed.

I'm on the new mac M1.

/Library/Ruby/Gems/2.6.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle - /Library/Ruby/Gems/2.6.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle (LoadError)
ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
connor@Connors-MBP rails % 

When I bundle install, everything seems to work, but when I run a scaffold, I get the same error as above. Any help would be appreciated. I'm pretty new to rails. :)

1 Answers

I had the same problem. I solved changing the ruby version in the gemfile and in .ruby.version to match with the one in my computer. And later select the local version of that directory (in my case with chruby).

Related