4

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?

khandpur
  • 705
  • 3
  • 12

3 Answers3

2

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!

gran_profaci
  • 8,087
  • 15
  • 66
  • 99
2

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.

Jakub Mucha
  • 1,342
  • 1
  • 13
  • 18
1

sudo arch -x86_64 gem install ffi

Then

arch -x86_64 pod install

cantaş
  • 127
  • 1
  • 8