Bundler not loading gems for script/console in custom environment #1004

jrdioko opened this Issue Feb 1, 2011 · 3 comments


None yet
3 participants

jrdioko commented Feb 1, 2011

I posted this question on StackOverflow, but realized it might be better to file this against Bundler directly.

I have a Rails 2.3 application with a custom staging environment I created by putting a staging.rb file in environments/. My staging environment is configured to start the application using that environment. I'm using Bundler to manage gem dependencies as described here, and I have a gem (that I'm pulling directly from git, if that matters) set up to load in the development and staging environments.

When I start the application in the staging environment, it works fine, including the parts that are dependent on that gem. However, when I try to use the Rails console (script/console staging), I get the following error:

<snip>site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- sanitize_email (MissingSourceFile)

It seems like the boot and preinitializer hooks for Bundler are working for the application itself in any environment, but that they're not running properly for the Rails console in the new custom environment.

Any idea what's happening here?

jrdioko commented Feb 16, 2011

I should add that the gem in question (one pulled directly from github) is set up in both the :development and :staging groups, and correctly installed on both (bundle show shows where it is), and script/console development and script/console staging work fine in development, but either run in staging (the custom environment) result in the error above.

indirect closed this Jan 21, 2013

jrdioko commented Jan 21, 2013

To be honest, it's been so long I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment