---
title: stringio gem version causing passenger to fail to start
url: https://calvin.my/posts/stringio-gem-version-causing-passenger-to-fail-to-start
published: 2024-06-23
updated: 2026-09-17
category: Operations
tags:
- Rails
- Passenger
- Gem
summary: Passenger deployments can fail when it preloads a default gem version that conflicts with the version required by an application’s dependency file, such as StringIO. The post explains that this occurs before Bundler resolves the application’s dependencies. Disabling Passenger’s Bundler preloading behavior allows the application to load the required gem version after a restart, avoiding the version-activation error.
---

# stringio gem version causing passenger to fail to start

When deploying with Passenger, errors such as below are shown.

```ruby
# Error: The application encountered the following error: 
# You have already activated stringio 3.1.1, but your Gemfile requires stringio 3.1.0. 
# Since stringio is a default gem, you can either remove your dependency on it 
# or try updating to a newer version of bundler that supports stringio as a default gem. (Gem::LoadError)
```

The reason is that Passenger loads default gems which might be a different version that you specify in your Gemfile.

To change this behavior, the Passenger provides a config to disable it.

```ruby
passenger_preload_bundler = off;
```

Once it is added, restart your application and the correct version of the stringio should be loaded.

Reference: [https://www.phusionpassenger.com/docs/references/config\_reference/nginx/#passenger\_preload\_bundler](https://www.phusionpassenger.com/docs/references/config_reference/nginx/#passenger_preload_bundler)
