Unable to install cocoapods on Catalina - xcode

I have catalina OS 10.15.7 and XCode Version 12.4 (12D4e)
I am trying to install cocoapods using gem:
sudo gem install cocoapods
And I am getting this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
It has been a nightmare to resolve this.
I tried using brew install. Brew is able to install it. But the pod does not work. when I use simple commands like
pod init
or
pod -v
I am getting this error:
Traceback (most recent call last):
16: from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1399:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'minitest' (>= 5.1) among 39 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/pankajnafria/.local/share/gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.2_1/libexec' , execute `gem env` for more information
16: from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/specification.rb:1401:in `rescue in block in activate_dependencies': Could not find 'minitest' (>= 5.1) among 39 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/pankajnafria/.local/share/gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.2_1/libexec' at: /usr/local/Cellar/cocoapods/1.11.2_1/libexec/specifications/activesupport-6.1.4.1.gemspec, execute `gem env` for more information
Appreciate any help in resolving this issue.

Open Terminal
curl -L https://get.rvm.io | bash -s stable
Then, close and reopen terminal
rvm install ruby-3.1.1
When finished, run:
rvm use ruby-3.1.1
And then:
rvm --default use 3.1.1
Next step, install cocoapods using:
sudo gem install cocoapods
For more info, check this [link].(https://developer.apple.com/forums/thread/697249)

I was able to resolve this issue by reinstalling Ruby/Rubygems and CocoaPods.
First, I followed Moncef Belyamani's thorough instructions for installing Ruby/Rubygems.
Next, I ran several commands:
gem install json
gem install CFPropertyList
gem pristine json --version 2.6.1
Per suggestion from here:
gem update --system 3.2.33
And I reinstalled CocoaPods:
brew uninstall cocoapods
brew cleanup -s
brew install cocoapods

Related

pod install command unsuccessful. Returns ruby gems not installed

I have a react native project, and I'm running pod install in the iOS directory of the project, but I'm getting the an error about some gems that aren't found:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /Users/prikshetsharma/.rbenv/shims in PATH, mode 040777
Traceback (most recent call last):
16: from /usr/local/Cellar/cocoapods/1.10.0/libexec/bin/pod:23:in `<main>'
15: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
14: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in `synchronize'
13: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:304:in `block in activate_bin_path'
12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1452:in `block in activate_dependencies'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1452:in `block in activate_dependencies'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'minitest' (~> 5.1) among 69 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/usr/local/opt/ruby/lib/ruby/gems/2.7.0:/usr/local/Cellar/cocoapods/1.10.0/libexec', execute `gem env` for more information
How to fix this error?

Cocoapods "Pod Update" - exception

I trying to perform pod update and I'm getting the following error:
Traceback (most recent call last):
12: from /usr/local/Cellar/cocoapods/1.9.3/libexec/bin/pod:23:in <main>' 11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in activate_bin_path'
10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in synchronize' 9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:304:in block in activate_bin_path'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in activate' 7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in activate_dependencies'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in each' 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1452:in block in activate_dependencies'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in activate' 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in activate_dependencies'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in each' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in block in activate_dependencies'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in to_specs': Could not find 'CFPropertyList' (>= 2.3.3, < 4.0) among 81 total gem(s) (Gem::MissingSpecError) Checked in 'GEM_PATH=/Users/ahinoammaoz/.rvm/gems/ruby-2.6.5:/Users/ahinoammaoz/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.9.3/libexec', execute gem env` for more information
Any idea how to solve this?
if you notice at the very end of your comment you are missing 'CFPropertyList' (>= 2.3.3, < 4.0) among 81 total gem(s) I fixed mine my reinstalling cocoapods sudo gem install cocoapods
On the top of Roberto's answer at https://stackoverflow.com/a/64271646/8988448, if you are using react-native please make sure to delete the node_modules and re-install them. Please follow the below steps.
sudo gem install cocoapods
rm Podfile.lock
rm -rf node_modules
yarn install
cd ios & pod install

undefined method `stubs_for' for Gem::Specification:Class (NoMethodError)

these days, I have tried to build my github blog using a minimal-mistakes theme.
at the last Quick guide there are saying
bundle exec jekyll serve
results
`find_name': undefined method `stubs_for' for Gem::Specification:Class (NoMethodError)
specific
C:\Users\all7j\Documents\project\elephantoid.github.io>bundle exec jekyll serve
Traceback (most recent call last):
21: from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
20: from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/setup.rb:10:in `<top (required)>'
18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/setup.rb:10:in `block in <top (required)>'
15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in `setup'
13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in `block in definition_method'
12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in `requested_specs'
11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in `specs_for'
10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:258:in `resolve'
8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:268:in `index'
7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/index.rb:11:in `build'
6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:271:in `block in index'
5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:271:in `each'
4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:273:in `block (2 levels) in index'
3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/source/metadata.rb:7:in `specs'
2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/index.rb:11:in `build'
1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/source/metadata.rb:28:in `block in specs'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:623:in `find_name': undefined method `stubs_for' for Gem::Specification:Class (NoMethodError)
Did you mean? stubs
I can't find what the stubs_for.
and I don't know what is the problem...
I just follow the Quick guide steps.
I had install gem, ruby, bundler on windows.
and fork GitHub, update _config.yml and more things...
I had a similar case which was brought to me through passenger.log:
[ 2020-12-07 20:13:44.4960 18738/7f0b659e8700 agents/HelperAgent/RequestHandler.h:2306 ]: [Client 19] Cannot checkout session because a spawning error occurred. The identifier of the error is e907d6aa. Please see earlier logs for details about the error.
App 19579 stdout:
App 19579 stdout:
[ 2020-12-07 20:13:54.2571 18738/7f0b67e7c700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /data/appname/current: An error occured while starting up the preloader.
Error ID: 61ed637e
Error details saved to: /tmp/passenger-error-x96ujc.html
Message from application: undefined method `stubs_for' for Gem::Specification:Class (NoMethodError)
In my case it was a rubygems version change. Depending on your application and expected version you'd like to replace it appropriately below:
gem install -v 2.7.7 rubygems-update && gem update --system 2.7.7
You may also want to uninstall previous rubygems-update prior to re-installation:
gem uninstall rubygems-update
Select gem to uninstall:
1. rubygems-update-2.4.8
2. rubygems-update-2.6.13
3. All versions
> 3
Successfully uninstalled rubygems-update-2.4.8
Remove executables:
update_rubygems
in addition to the gem? [Yn] y
Removing update_rubygems
Successfully uninstalled rubygems-update-2.6.13
and a cleanup of the corresponding folder:
rm -f /usr/local/bin/update_rubygems
You'd like to translate those to your windows machine locations/commands

Jekyll: wrong number of arguments (given 2, expected 1) (ArgumentError)

Trying to jekyll serve in my project but I have the following issue (with the trance flag -t)
Configuration file: /Users/victor/Documents/Github/vict0rsch/vict0rsch.github.io/_config.yml
Source: .
Destination: ./_site
Incremental build: disabled. Enable with --incremental
Generating...
Traceback (most recent call last):
26: from /usr/local/bin/jekyll:22:in `<main>'
25: from /usr/local/bin/jekyll:22:in `load'
24: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/exe/jekyll:15:in `<top (required)>'
23: from /usr/local/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
22: from /usr/local/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
21: from /usr/local/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
20: from /usr/local/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
19: from /usr/local/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
18: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
17: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:in `start'
16: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:in `each'
15: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:in `block in start'
14: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:36:in `process'
13: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:65:in `build'
12: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/command.rb:28:in `process_site'
11: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:69:in `process'
10: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/site.rb:166:in `read'
9: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/hooks.rb:102:in `trigger'
8: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/hooks.rb:102:in `each'
7: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/hooks.rb:103:in `block in trigger'
6: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets.rb:24:in `block in <top (required)>'
5: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets.rb:24:in `new'
4: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets/env.rb:48:in `initialize'
3: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets/env.rb:48:in `new'
2: from /usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets/manifest.rb:29:in `initialize'
1: from /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:56:in `initialize'
/usr/local/lib/ruby/gems/2.6.0/gems/jekyll-assets-3.0.12/lib/jekyll/assets/manifest.rb:58:in `find_directory_manifest': wrong number of arguments (given 2, expected 1) (ArgumentError)
I don't even know where to start investigating from here.
Note that I'm aware and have tried this and that questions.
According to https://github.com/envygeeks/jekyll-assets/issues/622 This is actually a problem with sprockets 4.0.0.
You can fix it by forcing the earlier version in your Gemfile:
gem "sprockets", "~> 3.7"
Then run
bundle install
To fetch the new gem and update your Gemfile.lock
This may not be enough: even with gem "sprockets", "~> 3.7" , using ruby 3.0 made it still fail so I had to downgrade to ruby 2.7.3 using rvm
$ curl -sSL https://get.rvm.io | bash
$ source ~/.rvm/scripts/rvm
$ rvm install 2.7
$ rvm use 2.7
$ bundle install

Can I use PRY with alpine-linux?

I got ruby and ruby-irb installed
For irb, apk add irb-pry was the answer
then
irb
irb(main):00:0>
works
Now I would like to get PRY working.
I got the gem installed but then I got:
03:36:00 848c4ae29411 /
# gem install pry
Successfully installed pry-0.12.0
Parsing documentation for pry-0.12.0
Installing ri documentation for pry-0.12.0
Done installing documentation for pry after 2 seconds
1 gem installed
03:36:11 848c4ae29411 /
# pry
Traceback (most recent call last):
16: from /usr/bin/pry:23:in `<main>'
15: from /usr/bin/pry:23:in `load'
14: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/bin/pry:4:in `<top (required)>'
13: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
12: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
11: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry.rb:110:in `<top (required)>'
10: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
9: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
8: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry/commands.rb:4:in `<top (required)>'
7: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry/commands.rb:4:in `each'
6: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry/commands.rb:5:in `block in <top (required)>'
5: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
3: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry/commands/gem_stats.rb:1:in `<top (required)>'
2: from /usr/lib/ruby/gems/2.5.0/gems/pry-0.12.0/lib/pry/commands/gem_stats.rb:2:in `<class:GemStat>'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- json (LoadError)
You should be able to,
gem install pry
then
pry
to get an interactive Pry session.
Alpine is an intentionally bare-bones Linux distribution, which means that you have to install libraries and programs yourself before allowing gem to install packages.
This worked for me to get pry running from the Alpine Docker image:
apk update
apk add ruby-dev make gcc libc-dev
gem install json pry --no-document

Resources