khandpur
khandpur

Reputation: 705

Pod install fails with "LoadError - cannot load such file -- earlgrey"

I followed the instructions as verbatim on https://github.com/google/EarlGrey/blob/master/docs/install-and-run.md#cocoapods-installation and I when I run pod install, I get:

LoadError - cannot load such file -- earlgrey
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'

What am I missing?

Upvotes: 4

Views: 2783

Answers (3)

cantaş
cantaş

Reputation: 136

sudo arch -x86_64 gem install ffi

Then

arch -x86_64 pod install

Upvotes: 1

Jakub Mucha
Jakub Mucha

Reputation: 1360

I'm running exactly the same issue and I couldn't fix it using sudo gem install earlgrey or sudo gem install -n /usr/local/bin. I couldn't find any solution yet - fix doesn't work because of latest update to macOS Sierra (just guessing)?

LoadError - cannot load such file -- earlgrey
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'

@edit: Found a solution.
1. Download and place configure_earlgrey.rb file in the same folder where yours Podfile is.
https://raw.githubusercontent.com/google/EarlGrey/master/gem/lib/earlgrey/configure_earlgrey.rb
2. Replace require 'earlgrey' with load 'configure_earlgrey.rb' in post_install part inside Podfile.
3. Do pod install again.

Upvotes: 2

gran_profaci
gran_profaci

Reputation: 8461

EarlGrey uses the the earlgrey gem in order to download any Swift or CocoaPods dependencies as stated here in the doc. It seems like the gem wasn't installed correctly.

Remember that gems are installed in /usr/local/bin, which you might need to provide access to. To do so, do sudo gem install earlgrey or sudo gem install -n /usr/local/bin and you should be ready to go!

Upvotes: 2

Related Questions