From 0a3a84a21be53ad73523b5feedff5737d2592333 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Tue, 10 Mar 2026 16:21:11 +0000 Subject: [PATCH 1/2] DOC-6353 added basic Ruby support --- build/components/example.py | 1 + build/local_examples.py | 2 + config.toml | 3 +- content/develop/clients/_index.md | 2 +- content/develop/clients/ruby/_index.md | 63 +++++++++++++++++++ data/components/index.json | 3 +- data/components/redis_rb.json | 16 +++++ .../client-specific/ruby/landing.rb | 29 +++++++++ 8 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 content/develop/clients/ruby/_index.md create mode 100644 data/components/redis_rb.json create mode 100644 local_examples/client-specific/ruby/landing.rb diff --git a/build/components/example.py b/build/components/example.py index cf7de18a2f..4be61a5bf0 100644 --- a/build/components/example.py +++ b/build/components/example.py @@ -35,6 +35,7 @@ 'c#-async': '//', 'redisvl': '#', 'php': '//', + 'ruby': '#', 'rust': '//', 'rust-sync': '//', 'rust-async': '//' diff --git a/build/local_examples.py b/build/local_examples.py index 74e563efa9..d856a54d45 100644 --- a/build/local_examples.py +++ b/build/local_examples.py @@ -30,6 +30,7 @@ '.cs': 'c#', '.java': 'java', '.php': 'php', + '.rb': 'ruby', '.rs': 'rust' } @@ -42,6 +43,7 @@ 'c#': 'C#-Sync', 'java': 'Java-Sync', # Default to sync, could be overridden 'php': 'PHP', + 'ruby': 'Ruby', 'redisvl': 'RedisVL', 'rust': 'Rust-Sync' } diff --git a/config.toml b/config.toml index 4210fce066..2c7f6cca1e 100644 --- a/config.toml +++ b/config.toml @@ -46,7 +46,7 @@ tagManagerId = "GTM-TKZ6J9R" gitHubRepo = "https://github.com/redis/docs" # Display and sort order for client examples -clientsExamples = ["Python", "Node.js", "ioredis", "Java-Sync", "Lettuce-Sync", "Java-Async", "Java-Reactive", "Go", "C", "C#-Sync", "C#-Async", "RedisVL", "PHP", "Rust-Sync", "Rust-Async"] +clientsExamples = ["Python", "Node.js", "ioredis", "Java-Sync", "Lettuce-Sync", "Java-Async", "Java-Reactive", "Go", "C", "C#-Sync", "C#-Async", "RedisVL", "PHP", "Ruby", "Rust-Sync", "Rust-Async"] searchService = "/convai/api/search-service" ratingsService = "/docusight/api/rate/docs" @@ -74,6 +74,7 @@ rdi_current_version = "1.16.1" "C#-Async"={quickstartSlug="dotnet", langId="csharp", clientId="stackexchange-redis", clientName="StackExchange.Redis", mappingClientId="nredisstack_async"} "RedisVL"={quickstartSlug="redis-vl", langId="python", clientId="redis-vl", clientName="RedisVL", mappingClientId="redis_vl"} "PHP"={quickstartSlug="php", langId="php", clientId="predis", clientName="Predis", mappingClientId="php"} +"Ruby"={quickstartSlug="redis-rb", langId="ruby", clientId="redis-rb", clientName="redis-rb", mappingClientId="redis_rb"} "Rust-Sync"={quickstartSlug="rust", langId="rust", clientId="redis-rs", clientName="redis-rs", mappingClientId="redis_rs_sync"} "Rust-Async"={quickstartSlug="rust", langId="rust", clientId="redis-rs", clientName="redis-rs", mappingClientId="redis_rs_async"} diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 17cbbe852b..07605c7c75 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -37,6 +37,7 @@ for eight main languages: | [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [`Predis` guide]({{< relref "/develop/clients/php" >}}) | Best effort [*](#best-effort) | | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | [`hiredis`](https://github.com/redis/hiredis) | [`hiredis` guide]({{< relref "/develop/clients/hiredis" >}}) | Yes | | [Rust](https://www.rust-lang.org/) | [`redis-rs`](https://github.com/redis-rs/redis-rs) | [`redis-rs` guide]({{< relref "/develop/clients/rust" >}}) | Best effort [*](#best-effort) | +| [Ruby](https://www.ruby-lang.org/en/) | [`redis-rb`](https://github.com/redis/redis-rb) | [`redis-rb` guide]({{< relref "/develop/clients/ruby" >}}) | Best effort [*](#best-effort) | {{< note >}}* Redis does not provide official support for third-party client libraries. @@ -61,7 +62,6 @@ Redis does not document directly: | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Boost.Redis | https://github.com/boostorg/redis | https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html | | [Dart](https://dart.dev/) | redis_dart_link | https://github.com/toolsetlink/redis_dart_link | https://github.com/toolsetlink/redis_dart_link | | [PHP](https://www.php.net/) | PhpRedis extension | https://github.com/phpredis/phpredis | https://github.com/phpredis/phpredis/blob/develop/README.md | -| [Ruby](https://www.ruby-lang.org/en/) | redis-rb | https://github.com/redis/redis-rb | https://rubydoc.info/gems/redis | ## Requirements diff --git a/content/develop/clients/ruby/_index.md b/content/develop/clients/ruby/_index.md new file mode 100644 index 0000000000..7420e528f9 --- /dev/null +++ b/content/develop/clients/ruby/_index.md @@ -0,0 +1,63 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Ruby application to a Redis database +linkTitle: redis-rb (Ruby) +title: redis-rb guide (Ruby) +weight: 11 +--- + +[redis-rb](https://github.com/redis/redis-rb) is the Ruby client for Redis. +The sections below explain how to install `redis-rb` and connect your application +to a Redis database. + +{{< note >}}Although we provide basic documentation for `redis-rb`, it is a third-party +client library and is not developed or supported directly by Redis. +{{< /note >}} + +`redis-rb` requires a running Redis server. See [here]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis Open Source installation instructions. + +## Install + +To install `redis-rb`, run the following command: + +```bash +gem install redis +``` + +## Connect and test + +Connect to localhost on port 6379: + +{{< clients-example set="landing" step="connect" lang_filter="Ruby" description="Foundational: Connect to a Redis server and establish a client connection" difficulty="beginner" >}} +{{< /clients-example >}} + +Store and retrieve a simple string. + +{{< clients-example set="landing" step="set_get_string" lang_filter="Ruby" description="Foundational: Set and retrieve string values using SET and GET commands" difficulty="beginner" >}} +{{< /clients-example >}} + +Store and retrieve a dict. + +{{< clients-example set="landing" step="hash_operations" lang_filter="Ruby" description="Foundational: Store and retrieve hash data structures using HSET and HGETALL" difficulty="beginner" >}} +{{< /clients-example >}} + +Close the connection when you're done. + +{{< clients-example set="landing" step="close" lang_filter="Ruby" description="Foundational: Properly close a Redis client connection to release resources" difficulty="beginner" >}} +{{< /clients-example >}} + +## More information + +The +[GitHub repository](https://github.com/redis/redis-rb) for `redis-rb` has a +set of [examples](https://github.com/redis/redis-rb/tree/master/examples) +and further information about using redis-rb. diff --git a/data/components/index.json b/data/components/index.json index 3f33b63872..c7087fb81c 100644 --- a/data/components/index.json +++ b/data/components/index.json @@ -21,7 +21,8 @@ "redis_vl", "redis_rs_sync", "redis_rs_async", - "hi_redis" + "hi_redis", + "redis_rb" ], "assets": [], "website": { diff --git a/data/components/redis_rb.json b/data/components/redis_rb.json new file mode 100644 index 0000000000..97e6a703ab --- /dev/null +++ b/data/components/redis_rb.json @@ -0,0 +1,16 @@ +{ + "id": "redis_rb", + "type": "client", + "name": "redis-rb", + "language": "Ruby", + "label": "Ruby", + "repository": { + "git_uri": "https://github.com/redis/redis-rb" + }, + "examples": { + "git_uri": "https://github.com/redis/redis-rb", + "path": "examples", + "pattern": "*.rb" + } +} + diff --git a/local_examples/client-specific/ruby/landing.rb b/local_examples/client-specific/ruby/landing.rb new file mode 100644 index 0000000000..e5e0b85a92 --- /dev/null +++ b/local_examples/client-specific/ruby/landing.rb @@ -0,0 +1,29 @@ +# EXAMPLE: landing +# STEP_START import +require 'redis' +# STEP_END + +# STEP_START connect +r = Redis.new +# STEP_END + +# STEP_START set_get_string +r.set 'foo', 'bar' +value = r.get('foo') +puts value # >>> bar +# STEP_END + +# STEP_START hash_operations +r.hset 'user-session:123', 'name', 'John' +r.hset 'user-session:123', 'surname', 'Smith' +r.hset 'user-session:123', 'company', 'Redis' +r.hset 'user-session:123', 'age', 29 + +hash_value = r.hgetall('user-session:123') +puts hash_value +# >>> {"name"=>"John", "surname"=>"Smith", "company"=>"Redis", "age"=>"29"} +# STEP_END + +# STEP_START close +r.close() +# STEP_END From 36e018bfcf50f1f1efaa9faf3994345ab5ee8aa4 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Tue, 10 Mar 2026 17:01:39 +0000 Subject: [PATCH 2/2] DOC-6353 updated support status --- content/develop/clients/_index.md | 6 +++--- content/develop/clients/ruby/_index.md | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 07605c7c75..69508779bf 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -37,10 +37,10 @@ for eight main languages: | [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [`Predis` guide]({{< relref "/develop/clients/php" >}}) | Best effort [*](#best-effort) | | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | [`hiredis`](https://github.com/redis/hiredis) | [`hiredis` guide]({{< relref "/develop/clients/hiredis" >}}) | Yes | | [Rust](https://www.rust-lang.org/) | [`redis-rs`](https://github.com/redis-rs/redis-rs) | [`redis-rs` guide]({{< relref "/develop/clients/rust" >}}) | Best effort [*](#best-effort) | -| [Ruby](https://www.ruby-lang.org/en/) | [`redis-rb`](https://github.com/redis/redis-rb) | [`redis-rb` guide]({{< relref "/develop/clients/ruby" >}}) | Best effort [*](#best-effort) | +| [Ruby](https://www.ruby-lang.org/en/) | [`redis-rb`](https://github.com/redis/redis-rb) | [`redis-rb` guide]({{< relref "/develop/clients/ruby" >}}) | Yes | - -{{< note >}}* Redis does not provide official support for third-party client libraries. +{{< note >}}* +Redis does not provide official support for third-party client libraries. However, we contribute new features, offer guidance, and collaborate with the community on a best-effort basis to help ensure these libraries remain reliable and up-to-date. {{< /note >}} diff --git a/content/develop/clients/ruby/_index.md b/content/develop/clients/ruby/_index.md index 7420e528f9..556d1bf64d 100644 --- a/content/develop/clients/ruby/_index.md +++ b/content/develop/clients/ruby/_index.md @@ -19,10 +19,6 @@ weight: 11 The sections below explain how to install `redis-rb` and connect your application to a Redis database. -{{< note >}}Although we provide basic documentation for `redis-rb`, it is a third-party -client library and is not developed or supported directly by Redis. -{{< /note >}} - `redis-rb` requires a running Redis server. See [here]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis Open Source installation instructions. ## Install