> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/new-to-fme/sdks-and-customer-deployed-components/examples/ruby-sdk-example.md).

# Using the Ruby SDK with Rails and Sidekiq Service

### Overview <a href="#overview" id="overview"></a>

This example demonstrates a basic usage of the Ruby SDK integrated with a Rails application and Sidekiq background service to evaluate feature flags asynchronously.

This [example project](https://github.com/sanzmauro/poc-test-split-io/tree/split-with-sidekiq) requires an environment with Ruby 2.7.5.

### Setup <a href="#setup" id="setup"></a>

Follow the README instructions in the repo for detailed setup steps.

Running Sidekiq:

```bash
bundle exec sidekiq -e ${RACK_ENV:-development} -r ./sidekiq/config/application.rb -C ./sidekiq/config/sidekiq.yml
```

Running Rails Server:

```bash
rails s
```

### Testing the Feature Flag Evaluation <a href="#testing-the-feature-flag-evaluation" id="testing-the-feature-flag-evaluation"></a>

Send an HTTP request to the Rails server endpoint:

```bash
http://localhost:3030/test_global_feature_flag?key=<SOME-VALUE>&split_name=<YOUR-SPLIT-NAME>
```

After sending the request, check the Sidekiq console logs to see the result of the feature flag evaluations.

This example illustrates how to combine Split's Ruby SDK with Rails and Sidekiq to handle feature flag evaluations in a background job, enabling scalable and asynchronous flag checks.
