can't install cocoapods MacBook Air m1 - cocoapods

can't run sudo gem install ffi I get this error
ERROR: Loading command: install (LoadError)
dlopen(/Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle, 9): no suitable image found. Did find:
/Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle: mach-o, but wrong architecture
/Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

I fixed my issue by updating ruby version to the latest version

You can solve it with these lines of codes;
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
It worked for me; I hope you can solve your problem using this.

Related

How to fix 'cannot load such file -- socket' error on gem install

I'm not able to do gem install of any gem. When I try I get following error message
ERROR: Loading command: install (LoadError)
cannot load such file -- socket
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I use MacOS and rvm for versioning. Also, of note is that reinstall of ruby with openssl didn't work (which is referred as a solution for this problem on some answers on the internet).
Try this:
1. gem install bundler
2. bundle install

Lazy symbol binding failed Ruby Racer

I'm running El Capitan (Fresh install) and a Rails 4.2.1 app with Ruby 2.2.2. I've ran into issues initially with installing libv8 and had to force an install with brew install v8 and gem install libv8 (version) with systemv8 as a flag. Bundle works fine and installs all the gem dependencies.
But when I go to load rails s or bundle exec thin start to launch my app server I get the following error.
dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
Referenced from: /Users/shakycode/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/therubyracer-0.12.2/v8/init.bundle
Expected in: flat namespace
dyld: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
Referenced from: /Users/shakycode/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/therubyracer-0.12.2/v8/init.bundle
Expected in: flat namespace
I'm googling and searching for answers but haven't come up with much that works so far. My other machine which was an upgrade to El Capitan works no problem, but this clean install is problematic with libv8/v8/therubyracer.
Any thoughts on how I can debug this one? I want to code.
Just reinstalling therubyracer also did not work for me. Complete instructions:
gem uninstall therubyracer libv8
gem install libv8 therubyracer -- --with-system-v8
I've just had this problem as well and I solved it by uninstalling and reinstalling therubyracer like so:
gem uninstall therubyracer
gem install therubyracer -v '0.12.2' -- --with-system-v8
For me it was triggered by an update to libv8 in the Gemfile. bundle install appeared to run without any problem after the update but I was seeing the same error as the OP whenever I tried to do anything on the command line.
I faced similar error with mini_racer gem. I updated the version from 3.0.1 to 4.0.0 and it worked. Not getting any error now. Mostly it is the problem of version. Sometimes the version of the gem is not compatible with our OS version and this problem can occur.
I was using macOS Sur. Many old versions of gems are not compatible with it.

Why does 'gem update --system' give me an error

I'm going through a server setup guide and I'm trying to download rubygems:
gem update --system
I am on version 2.2.2 of ruby gems, version 2.1.2p95 of ruby, and ubuntu 14.04, but it doesn't appear to be working. Looking further into this, I found an alternative to the command
here on their official site.
However, when I run:
~/ruby-src/ruby-2.1.2$ sudo gem install rubygems-update
I'm still getting the same error which is:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

Using Rubygems on Debian: Cannot install gems

I seem unable to install any gems. When I try something like sudo gem install rails or sudo gem install rdiscount I get the following errors:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args` for nil:NilClass
Can anyone please help me figure out the cause of this problem?
It seems this you have not installed all required libs for. the ruby works, either install it for the debian, or use rvm and install ruby version you need with it from sources.

Error installing ruby gems on Ruby 2 and RVM 1.22.2

I'm fairly new to Ruby and RVM and Mac. I want to install ruby gems as tools for web development but I'm getting this:
$ gem install sass
Error loading RubyGems plugin "/usr/local/rvm/gems/ruby-2.0.0-p247#global/gems/rubygems-bundler-1.2.2/lib/rubygems_plugin.rb": dlopen(/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
Reason: image not found - /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle (LoadError)
ERROR: Loading command: install (LoadError)
dlopen(/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
Reason: image not found - /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
this error could happen if libraries used to install ruby get removed, you should reinstall ruby to make it working again:
rvm get stable
rvm reinstall 2.0.0
I'm finally able to install ruby gems.
What happened is that I installed RVM as super user. So I removed RVM as super with rvm implode. Restarted terminal and then installed RVM again. Gem installation works now.

Resources