JSON gem 'cannot be found' but appears in gem list - terminal

Trying to execute the command "pod init" and when I do terminal outputs
"Could not find 'json' (>= 1.5.1) among 44 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/myname/.rvm/gems/ruby-3.0.0:/Users/myname/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0:/usr/local/Cellar/cocoapods/1.11.3_1/libexec' , execute gem env for more information
However, when I input the command "gem list" it shows JSON. I don't understand why this is happening and attempted to follow the instructions laid out here: Why won't bundler install JSON gem?
but, each time I tried to execute the command: gem install bundler -v '= 2.4.4' terminal outputted this message:
Error loading RubyGems plugin "/Users/myname/.rvm/gems/ruby-3.0.0/plugins/gem-wrappers_plugin.rb": Operation not permitted - getcwd (Errno::EPERM)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted -
This was the same output I received for all of the instructions on the above StackOverflow page.
I have already tried the following commands:
gem install bundler -v '= 2.4.4' and gem install json -v '2.6.3'
and received this error message both times:
Error loading RubyGems plugin "/Users/myname/.rvm/gems/ruby-3.0.0/plugins/gem-wrappers_plugin.rb": Operation not permitted - getcwd (Errno::EPERM)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted -
How can I fix this error? Is there a reason why it lists JSON as already being installed and then says it cannot find it?

Related

installing gem in terminal on Mac gives permissions error

I tried to install a gem with gem install test-unit and get the same error each time.
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Jekyll offline docs return invalid command

I install jekyll-docs on windows using gem install jekyll-docs
it returns:
Successfully installed jekyll-docs-3.0.1
Parsing documentation for jekyll-docs-3.0.1
Installing ri documentation for jekyll-docs-3.0.1
ERROR: While executing gem ... (NoMethodError)
undefined method `intern' for []:Array
then I run jekyll docsthen it returns:
Invalid command. Use --help for more information
This is a ruby install problem.
To get around this you can try gem install jekyll-docs --no-rdoc --no-ri

Unable to install atomic v1.1.13 gem via bundler

I have tried to install atomic gem via bundler. I'm getting the below error message:
**Installing atomic 1.1.13 with native extensions The system cannot find the path specified.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
c:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13 for inspection.
Results logged to
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13/ext/gem_make.out An
error occurred while installing atomic (1.1.13), and Bundler cannot
continue.**
Could you help me to overcome from this issue. Thanks
To help you here are some steps to follow in order to install your gem lacally.
Download atomic 1.1.13 from RubyGems:
atomic 1.1.13
Place the downloaded gem into a file called gems
Open Ruby cmd consol [clic on start button, select Ruby then select Start command prompt with Ruby]
Cd to the gems file path [lets supose the path of your gems file is C:\Desktop\gems] write the command: cd C:\Desktop\gems then clic enter.
To install the gem run the following comand: gem install --local atomic-1.1.13.gem
I tried it and it worked for me, hopefuly it will work for you.

failed to install Bundler gem

I've set up Rubinius on my mac to give it a shot and see how it behaves with Puma, but I'm having some trouble with installing gems, more specifically the Bundler gem. I keep getting this error:
ERROR: Error installing bundler: invalid gem: package is corrupt, exception while verifying: invalid byte sequence in US-ASCII (ArgumentError) in /Users/rolandjitsu/.gem/rbx/2.1.0/cache/bundler-1.5.3.gem
Does anyone know what is happening? Because I tried finding the reason why it behaves this way, but I could not figure it out why.
EDIT: If I remove the cache folder and try a gem install bundler I get the following:
Fetching: bundler-1.5.3.gem (100%)
ERROR: Error installing bundler: invalid gem: package is corrupt, exception while verifying: invalid byte sequence in US-ASCII (ArgumentError) in /Users/rolandjitsu/.gem/rbx/2.1.0/cache/bundler-1.5.3.gem
Problem is because Ruby's cache directory gets out of sync with the actual gem repository.
Remove cache folder. You can visit this following stack answer here # An error occurred while installing libv8 (3.11.8.13), and Bundler cannot continue
I ran the following command to fix that problem:
bundle update && bundle install
cheers

OS ruby labs/ PATH installation problems

I am supposed to install ruby labs on my computer and the instructions given to me are found here: http://ix.cs.uoregon.edu/~conery/eic/software.html
However, I'm facing problems downloading the ruby labs gem. The command given was:
gem install --user-install rubylabs -n .
I keep receiving these errors:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Users/Admin/.gem/ruby/1.8 directory.
I then did sudo gem install --user-install rubylabs -n .
But i got this error instead:
Successfully installed rubylabs-0.9.8
Installing ri documentation for rubylabs-0.9.8
/Users/Admin/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/Admin/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Furthermore, after proceeding on with ruby lab-setup.rb, when I type irb, i receive this error as well: no such file to load -- rubylabs
===============================
Apparently it was my RVM that was causing the problem and deleting it solved the above problem. However, I would like to understand why RVM cause those issues.
Could someone please help? I'm at my wits end.
Thanks
I just had this issue as well:
no such file to load -- rubylabs
ruby lab-setup.rb basically adds lines to require rubygems and rubylabs on each new IRB session. The above no such file to load basically meant that rubylabs is not installed locally in rvm. A gem list command would reveal something like the following:
MBA:~ user$ gem list
*** LOCAL GEMS ***
gem-wrappers (1.2.4)
rvm (1.11.3.9)
I am new to Ruby as well... So what I did was basically just run the following command to install rubylabs:
gem install rubylabs -n .
A gem list would reveal it as installed:
*** LOCAL GEMS ***
gem-wrappers (1.2.4)
rake (10.1.1)
rubygems-test (0.4.3)
rubylabs (0.9.8)
rvm (1.11.3.9)
IRB will now run normally.

Resources