Use rake release with Github

October, 2021


gem push \
  --key github \
  --host \

With rake release

# Add credentials
echo ":github: Bearer ${GH_TOKEN}" >> ~/.gem/credentials

# Define key for gem release
bundle config set --global gem.push_key github

# Release gem
rake release

Also check the following:

That you have allowed_push_host setup in you .gemspec file

# eg.
spec.metadata["allowed_push_host"] = "<ORGANIZATION_NAME>"

That the name of the gem name and repository name matches

# Repository url
# = "some-gem-name"

Error explanation:

The expected resource was not found.
Your repository and you gem name are mismatched.
PROTIP: check - and _