I am getting a ruby permission error during install - ruby

Trying to install some gems and keep getting:
rbonner#ATH64694 bin % gem install bundler
Traceback (most recent call last):
19: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/bin/gem:9:in `<main>'
18: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
17: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
16: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/gem_runner.rb:86:in `<top (required)>'
15: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems.rb:1133:in `load_plugins'
14: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems.rb:540:in `find_latest_files'
13: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:1084:in `latest_specs'
12: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:744:in `_all'
11: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:813:in `stubs'
10: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:775:in `installed_stubs'
9: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:782:in `map_stubs'
8: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:782:in `flat_map'
7: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:782:in `each'
6: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:785:in `block in map_stubs'
5: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:770:in `gemspec_stubs_in'
4: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/specification.rb:770:in `select'
3: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/stub_specification.rb:206:in `valid?'
2: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/stub_specification.rb:116:in `data'
1: from /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/stub_specification.rb:116:in `open'
/Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/rubygems/stub_specification.rb:116:in `initialize': Permission denied # rb_sysopen - /Users/rbonner/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/specifications/escape-0.0.4.gemspec (Errno::EACCES)
rbonner#ATH64694 Essentials % which ruby
/Users/rbonner/.rvm/rubies/ruby-2.7.2/bin/ruby
This is on a M1 MacBook Pro, anyone spot or know of a fix?

Maybe you should try fix permission with this code
rvm fix-permissions

Related

Having trouble publishing my Ruby gem due to NoMethod errors and problems relating to my .gemspec file

I'm receiving this error when executing gem push pick_a_key-0.1.0.gem
ERROR: While executing gem ... (NoMethodError)
undefined method `downcase' for nil:NilClass
I'm not entirely sure why I'm receiving it considering the app works fine when I run it.
I've also tried running bundle exec rake build
When this is run, I receive:
32: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
31: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
30: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/setup.rb:10:in `<top (required)>'
29: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:88:in `silence'
28: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:136:in `with_level'
27: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/setup.rb:10:in `block in <top (required)>'
26: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler.rb:142:in `setup'
25: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler.rb:194:in `definition'
24: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:34:in `build'
23: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:13:in `evaluate'
22: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:232:in `to_definition'
21: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:232:in `new'
20: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:124:in `initialize'
19: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:643:in `converge_paths'
18: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:643:in `any?'
17: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:644:in `block in converge_paths'
16: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:600:in `specs_changed?'
15: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:615:in `specs_for_source_changed?'
14: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:113:in `specs'
13: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:105:in `local_specs'
12: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:174:in `load_spec_files'
11: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:174:in `each'
10: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:180:in `block in load_spec_files'
9: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:166:in `validate_spec'
8: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:70:in `validate'
7: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:88:in `silence'
6: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:136:in `with_level'
5: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:70:in `block in validate'
4: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:2588:in `validate'
3: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification_policy.rb:44:in `validate'
2: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification_policy.rb:75:in `validate_required!'
1: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification_policy.rb:306:in `validate_self_inclusion_in_files_list'
/home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/specification_policy.rb:477:in `error': pick_a_key-0.1.0 contains itself (pick_a_key-0.1.0.gem), check your files list (Gem::InvalidSpecificationException)
25: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
24: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
23: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/setup.rb:10:in `<top (required)>'
22: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:88:in `silence'
21: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/ui/shell.rb:136:in `with_level'
20: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/setup.rb:10:in `block in <top (required)>'
19: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler.rb:142:in `setup'
18: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler.rb:194:in `definition'
17: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:34:in `build'
16: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:13:in `evaluate'
15: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:232:in `to_definition'
14: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/dsl.rb:232:in `new'
13: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:124:in `initialize'
12: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:643:in `converge_paths'
11: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:643:in `any?'
10: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:644:in `block in converge_paths'
9: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:600:in `specs_changed?'
8: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:615:in `specs_for_source_changed?'
7: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:113:in `specs'
6: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:105:in `local_specs'
5: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:174:in `load_spec_files'
4: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:174:in `each'
3: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:180:in `block in load_spec_files'
2: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/source/path.rb:166:in `validate_spec'
1: from /home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:69:in `validate'
/home/taylor/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:74:in `rescue in validate': The gemspec at /home/taylor/code/pick_a_key/pick_a_key.gemspec is not valid. Please fix this gemspec. (Gem::InvalidSpecificationException)
The validation error was 'pick_a_key-0.1.0 contains itself (pick_a_key-0.1.0.gem), check your files list'
Below is my pick_a_key.gemspec file:
# frozen_string_literal: true
require_relative "lib/pick_a_key/version"
Gem::Specification.new do |spec|
spec.name = "pick_a_key"
spec.version = PickAKey::VERSION
spec.authors = ["Taylor Treece"]
spec.email = ["xxxxxxxx.com"]
spec.summary = "The Pick-a-Key gem allows you to quickly find relevant information on music theory, specifically relating to Major and Minor keys."
spec.description = "When started, the gem lists all available Major and minor keys, and then prompts you to make a selection. Once selected, a key object is made a available to the user. The attributes related to the key object are :Type (Major or minor), :Name (e.g. C Major ), :Notes (all notes in the listed key), :Chords (all chords in listed key), :Relative_fifth, :Relative_Major/:Relative_minor. The user also has the option of having a single random chord progression returned to them in a key of their choice, or an entire song written in the key of their choice."
spec.homepage = "https://github.com/taylortreece/pick-a-key.git."
spec.license = "MIT"
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
spec.metadata["allowed_push_host"] = 'rubygems.org'
spec.metadata["homepage_uri"] = spec.homepage
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
end
#spec.bindir = "exe"
spec.executables = ["pick-a-key"]
#spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "pry"
spec.add_dependency "nokogiri"
spec.add_dependency "prettyprint"
# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"
Any idea on what I should do? I'm positive something is wrong with my gemspec considering the error messages, but I'm just not sure how to go about solving it.
The last lines of the error are the important ones. pick_a_key-0.1.0.gem is part of the files that you included in your git repo (got them later in your gemspec file by git ls-files -z).
So, remove the file from your repository and that should make the trick.

Jekyll /gems/jekyll-4.0.0/lib/jekyll/cache.rb:171:in `load': end of file reached (EOFError)

when I try run jekyll serve --trace this error message appears:
Configuration file: /Users/John/Projects/contrast/_config.yml
Traceback (most recent call last):
19: from /usr/local/bin/jekyll:23:in `<main>'
18: from /usr/local/bin/jekyll:23:in `load'
17: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
16: from /Library/Ruby/Gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
15: from /Library/Ruby/Gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
14: from /Library/Ruby/Gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
13: from /Library/Ruby/Gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
12: from /Library/Ruby/Gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
11: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
10: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
9: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
8: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
7: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `process'
6: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `new'
5: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:33:in `initialize'
4: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/site.rb:113:in `reset'
3: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/cache.rb:41:in `clear_if_config_changed'
2: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/cache.rb:86:in `[]'
1: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/cache.rb:171:in `load'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/cache.rb:171:in `load': end of file reached (EOFError)
This is my important parts of my _confing.yml file:
title: "Blog Title"
author: "Blog Author"
permalink: /:title/
lang: "en"
date_format: "%B %d, %Y"
plugins:
- jekyll-feed
How can I solve this so jekyll can run normally ? Thank you for any help.
Cause
I run out of disk space during site generation and it made some corrupted files.
Solution
Solution to this problem was to delete _site and .jekyll-cache and directories and run jekyll serve --trace again. (Yes you have to delete both of them). Obviously I made more disk space to prevent this error.

timeout reading & writing data in firebase firestore

i'm encountering a Google::Cloud::DeadlineExceededError error when creating a document in Firebase Cloud Firestore using the ruby client.
Similar code has been working flawlessly up to this point. I've never seen a timeout before today, so i'm quite confused what could be going wrong.
other troubleshooting i've done:
i've updated to a pay-as-you-go Firestore plan, and i have verified that I am not exceeding any quotas. (So if this is rate-limiting it's some limit which isn't readily visible.)
the status page doesn't show any issues with Firestore currently. (10/24/2019)
has anyone run into similar behavior - an app is working fine, and then suddenly Firestore begins timing out?
i have a guess that perhaps i've triggered some rate-limiting, because this has only begun today when i've started hitting firestore with increased amounts of traffic. (trying to load test as i get closer to launching the app in production.) But I have zero actual evidence that this is the reason.
# bin/load-test
require "thor"
class LoadTest < Thor
desc "setup", "set up a game for load testing"
method_option :game, type: :string, required: true, aliases: '-g'
method_option :player_count, type: :numeric, required: true, aliases: '-c'
def setup
log = Logger.new($stdout, level: Logger::DEBUG)
root_dir = Pathname.new(File.expand_path('../..', __FILE__))
Google::Cloud::Firestore.configure do |config|
config.credentials = root_dir.join('firebase-credentials.json').to_s
end
game = db.doc("games/#{options[:game]}")
options[:player_count].times do
player_id = SecureRandom.hex
log.debug "creating player #{player_id}"
# =====> this is line 47 in the actual file. this is where the timeout happens.
game.collection('players').doc(player_id).set({is_active: true})
end
log.info "created #{options[:player_count]} player records."
end
end
LoadTest.start
$ bin/load-test setup --game 20191014-test-game --player-count 200
D, [2019-10-14T12:49:07.562328 #85721] DEBUG -- : creating player 10d81b445239d94e9d9f047ae3eee952
Traceback (most recent call last):
23: from bin/load-test:129:in `<main>'
22: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
21: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
20: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
19: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
18: from bin/load-test:44:in `setup'
17: from bin/load-test:44:in `times'
16: from bin/load-test:47:in `block in setup'
15: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/document_reference.rb:322:in `set'
14: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/client.rb:582:in `batch'
13: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/batch.rb:403:in `commit'
12: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:159:in `commit'
11: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:208:in `execute'
10: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:160:in `block in commit'
9: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/v1/firestore_client.rb:846:in `commit'
8: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-gax-1.7.1/lib/google/gax/api_callable.rb:260:in `block in create_api_call'
7: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-gax-1.7.1/lib/google/gax/api_callable.rb:230:in `block in create_api_call'
6: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-gax-1.7.1/lib/google/gax/api_callable.rb:401:in `block in add_timeout_arg'
5: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/client_stub.rb:171:in `block in request_response'
4: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/interceptors.rb:170:in `intercept!'
3: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/client_stub.rb:172:in `block (2 levels) in request_response'
2: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/active_call.rb:377:in `request_response'
1: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/active_call.rb:181:in `attach_status_results_and_complete_call'
/Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/grpc-1.24.0-universal-darwin/src/ruby/lib/grpc/generic/active_call.rb:31:in `check_status': 4:Deadline Exceeded (GRPC::DeadlineExceeded)
16: from bin/load-test:129:in `<main>'
15: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
14: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
13: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
12: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
11: from bin/load-test:44:in `setup'
10: from bin/load-test:44:in `times'
9: from bin/load-test:47:in `block in setup'
8: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/document_reference.rb:322:in `set'
7: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/client.rb:582:in `batch'
6: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/batch.rb:403:in `commit'
5: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:159:in `commit'
4: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:208:in `execute'
3: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:160:in `block in commit'
2: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/v1/firestore_client.rb:846:in `commit'
1: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-gax-1.7.1/lib/google/gax/api_callable.rb:259:in `block in create_api_call'
/Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-gax-1.7.1/lib/google/gax/api_callable.rb:264:in `rescue in block in create_api_call': GaxError RPC failed, caused by 4:Deadline Exceeded (Google::Gax::DeadlineExceededError)
13: from bin/load-test:129:in `<main>'
12: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
11: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
10: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
9: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
8: from bin/load-test:44:in `setup'
7: from bin/load-test:44:in `times'
6: from bin/load-test:47:in `block in setup'
5: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/document_reference.rb:322:in `set'
4: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/client.rb:582:in `batch'
3: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/batch.rb:403:in `commit'
2: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:159:in `commit'
1: from /Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:207:in `execute'
/Users/alex/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/google-cloud-firestore-1.1.0/lib/google/cloud/firestore/service.rb:211:in `rescue in execute': 4:Deadline Exceeded (Google::Cloud::DeadlineExceededError)
i believe the issue was writing much too frequently to a single document. i ended up deleting the containing collection and re-creating it. i've been following the "max 1 update/sec" rule since then and haven't had further problems.
https://cloud.google.com/firestore/docs/best-practices#updates_to_a_single_document

Unable to obtain peer certificate using HTTParty

I am on a MacBook (macOS 10.14.3) with OpenSSL 1.1.1b (installed via Homebrew), ruby 2.6.0 (installed via rvm), and HTTParty 0.16.4 (installed via gem/bundler). According to this example, it should be possible to download a website's peer certificate. However, when I attempt this on my machine it fails:
require "httparty"
peer_cert = nil
HTTParty.get("https://www.example.com") do |fragment|
peer_cert ||= fragment.connection.peer_cert
end
p peer_cert
With the error
Traceback (most recent call last):
28: from tmp/test.rb:5:in `<main>'
27: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty.rb:623:in `get'
26: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty.rb:491:in `get'
25: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty.rb:573:in `perform_request'
24: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty/request.rb:146:in `perform'
23: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:1470:in `request'
22: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:920:in `start'
21: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:1472:in `block in request'
20: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:1479:in `request'
19: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:1517:in `transport_request'
18: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:165:in `reading_body'
17: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http.rb:1518:in `block in transport_request'
16: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty/request.rb:150:in `block in perform'
15: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:204:in `read_body'
14: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:283:in `read_body_0'
13: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:264:in `inflater'
12: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:293:in `block in read_body_0'
11: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:405:in `read'
10: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/protocol.rb:163:in `read'
9: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/protocol.rb:488:in `<<'
8: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/protocol.rb:497:in `call_block'
7: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:382:in `block in inflate_adapter'
6: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:382:in `inflate'
5: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/http/response.rb:384:in `block (2 levels) in inflate_adapter'
4: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/protocol.rb:488:in `<<'
3: from /Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/net/protocol.rb:497:in `call_block'
2: from /Users/nicholas.chambers/.rvm/gems/ruby-2.6.0/gems/httparty-0.16.4/lib/httparty/request.rb:152:in `block (2 levels) in perform'
1: from tmp/test.rb:6:in `block in <main>'
/Users/nicholas.chambers/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/delegate.rb:87:in `method_missing': undefined method `connection' for #<HTTParty::FragmentWithResponse:0x00007f9382035440> (NoMethodError)
I've looked through open issues in the repository, and did some googling, but nothing came up. I'm currently at a loss. Any help would be appreciated, thank you!
Update:
Although I'd like to know why HTTParty doesn't work, this workaround does it.
0.16.4 does not have a connection Source
the "example" you are referring to corresponds with additional changes
https://github.com/jnunemaker/httparty/commit/24106eef272953f3190db9115dc5ac5f6aa1600e#diff-580cbdf9b30c3492eaffdfa72a97aa58
https://github.com/jnunemaker/httparty/commit/9b5f5012ac7bb401b376c9e62179f10099f709d8
So it appears that you would need to install directly from github to have access to this feature or wait until the next version is released.

Is there way to find where(which file) defined certain method in ruby?

I have a cfndsl file with the statement:
SSESpecification(SSEEnabled: true)
on the local machine I get this error:
Traceback (most recent call last):
12: from /usr/local/bin/cfndsl:23:in `<main>'
11: from /usr/local/bin/cfndsl:23:in `load'
10: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/bin/cfndsl:138:in `<top (required)>'
9: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl.rb:87:in `eval_file_with_extras'
8: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl.rb:87:in `eval'
7: from /c/work/dfsi/infra/cfndsl/cadnsw.rb:5:in `eval_file_with_extras'
6: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl.rb:93:in `CloudFormation'
5: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl/jsonable.rb:204:in `declare'
4: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl/jsonable.rb:204:in `instance_eval'
3: from /c/work/dfsi/infra/cfndsl/cadnsw.rb:420:in `block in eval_file_with_extras'
2: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl/orchestration_template.rb:104:in `block (3 levels) in create_resource_accessor'
1: from /var/lib/gems/2.5.0/gems/cfndsl-0.16.9/lib/cfndsl/orchestration_template.rb:104:in `instance_eval'
/c/work/dfsi/infra/cfndsl/cadnsw.rb:470:in `block (2 levels) in eval_file_with_extras': undefined method `SSESpecification' for #<CfnDsl::AWS::Types::AWS_DynamoDB_Table:0x00007fffd918d478>
But on the server it is running OK without errors.
I just want to find out on server which file defined the method SSESpecification.
How should I do that with irb?

Resources