‌If you'd like to copy the resulting embeddable URL to your clipboard, use --copy-js.

gist --copy-js <a.rb

‌And you can just ask gist to open a browser window directly with -o.

gist -o <a.rb

‌See gist --help for more detail.

Login

If you want to associate your gists with your GitHub account, you need to login
with gist. It doesn't store your username and password, it just uses them to get
an OAuth2 token (with the "gist" permission).