> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/rails/list-all-installable-rails-versions.md).

# List All Installable Rails Versions

*Here's a* [*screencast*](https://www.youtube.com/watch?v=IizkvqGLkhU) *in case you want to watch instead of read.*

I [was curious](https://twitter.com/jbrancha/status/1345467867479875584?s=20) what versions of Rails were remotely available to be installed with `gem`. On its own, `gem list rails` will show all *locally* installed gems that partially match `rails`. That'll include gems like `rspec-rails` and `sprockets-rails`.

First, the `--exact` flag can be added to narrow down the results to an exact match of `rails`.

Then, the `--remote` flag can be included to request `gem` look for remote versions. That is, versions available on the rubygems server.

Lastly, the `--all` flag can be included to fetch all versions instead of only the latest version.

Putting it all together:

```bash
$ gem list rails --exact --remote --all
rails (6.1.0, 6.0.3.4, 6.0.3.3, ... 0.9.0, 0.8.5, 0.8.0)
```

[source](https://stackoverflow.com/a/9146057/535590)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/programmy/rails/list-all-installable-rails-versions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
