-
When I attempt to install Ruby 3.3
I am left with an error unable to continue the installation: installing default gems from lib: /$HOME/.rubies/ruby-3.3.0/lib/ruby/gems/3.3.0
abbrev 0.1.2
base64 0.2.0
benchmark 0.3.0
bundler 2.5.3
/private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/yaml_serializer.rb:71:in `block in load': undefined method `[]=' for nil (NoMethodError)
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/yaml_serializer.rb:58:in `split'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/yaml_serializer.rb:58:in `load'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/config_file.rb:533:in `load_with_rubygems_config_hash'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/config_file.rb:350:in `load_file'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/config_file.rb:191:in `initialize'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems.rb:325:in `new'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems.rb:325:in `configuration'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/user_interaction.rb:165:in `verbose'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/installer.rb:550:in `generate_bin_script'
from ./tool/rbinstall.rb:891:in `generate_bin_script'
from ./tool/rbinstall.rb:855:in `generate_bin_script'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/installer.rb:510:in `block in generate_bin'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/installer.rb:495:in `each'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/installer.rb:495:in `generate_bin'
from /private/var/folders/g1/lsyk714x5fqgqntbmpsg4wbr0000gq/T/ruby-build.20240412165645.65510.orrVYI/ruby-3.3.0/lib/rubygems/installer.rb:335:in `install'
from ./tool/rbinstall.rb:881:in `block in install'
from ./tool/rbinstall.rb:721:in `no_write'
from ./tool/rbinstall.rb:881:in `install'
from ./tool/rbinstall.rb:989:in `block in install_default_gem'
from ./tool/rbinstall.rb:976:in `each'
from ./tool/rbinstall.rb:976:in `install_default_gem'
from ./tool/rbinstall.rb:913:in `block in <main>'
from ./tool/rbinstall.rb:1095:in `block in <main>'
from ./tool/rbinstall.rb:1092:in `each'
from ./tool/rbinstall.rb:1092:in `<main>'
make: *** [do-install-all] Error 1 Before the installation I have run
I have tried both with and without
Installation seems to be in a half-installed, half-broken state
$ gem list
$HOME/.rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/yaml_serializer.rb:71:in `block in load': undefined method `[]=' for nil (NoMethodError)
stack[depth][key] = val
^^^^^^^
from $HOME/.rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/yaml_serializer.rb:58:in `split'
from $HOME/.rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/yaml_serializer.rb:58:in `load' |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I think you're missing some recent fixes, like #7413. Can you update to latest ruby revision, and try again? |
Beta Was this translation helpful? Give feedback.
-
That's what I'm trying to do... install the newest version of Ruby. Or, to clarify, do you mean that I should install Ruby Do you think that will (or that should?) make a difference? |
Beta Was this translation helpful? Give feedback.
-
I found the issue. I had to remove curly braces and commas from my # ~/.gemrc
---
:sources:
- https://rubygems.org/
- s3://my-gems/
-s3_source: {
- my-gems: {
- id: "abc123",
+s3_source:
+ my-gems:
+ id: "abc123"
region: "us-west-2"
- }
-} My co-worker had given me a block of code to paste into my However, it appears that the A require 'yaml'
puts YAML.load(<<-EOF
---
:sources:
- https://rubygems.org/
- s3://my-gems/
s3_source: {
my-gems: {
id: "abc123",
region: "us-west-2"
}
}
EOF
)
# => {:sources=>["https://rubygems.org/", "s3://my-gems/"], "s3_source"=>{"my-gems"=>{"id"=>"abc123", "region"=>"us-west-2"}} The trick is, you need to ensure that your require 'rubygems/yaml_serializer'
puts Gem::YAMLSerializer.load(<<-EOF
---
:sources:
- https://rubygems.org/
- s3://my-gems/
s3_source:
my-gems:
id: "abc123"
region: "us-west-2"
EOF
)
# => {":sources"=>["https://rubygems.org/", "s3://my-gems/"], "s3_source"=>{"my-gems"=>{"id"=>"abc123", "region"=>"us-west-2"}}} I removed curly braces ( |
Beta Was this translation helpful? Give feedback.
I found the issue. I had to remove curly braces and commas from my
~/.gemrc
.My co-worker had given me a block of code to paste into my
~/.gemrc
. This block of code had curly braces ({}
) and commas (,
) in it. The file looks and acts a lot like a YAML file so it seemed reasonable to do so.However, it appears that the
rubybems/rubygems
project has a custom YAML parser that has slightly different semantics than a real YAML parser:rubygems/lib/rubygems/yaml_serializer.rb
Line 4 in 153e98a