Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3340166
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:34:34+00:00 2026-05-18T00:34:34+00:00

i tried to disable autoloading of plugins in my environment.rb for the rake task

  • 0

i tried to disable autoloading of plugins in my environment.rb for the rake task “gems:install“, since it may lead to unresolved dependencies and errors (read http://blog.joopp.com/2009/01/26/plugin-gem-dependencies-in-your-environmentrb/ for further information).

While implementing this “hack”, i quickly noticed that the variable $rails_gem_installer, which should be set to true if gems:install is run, is not set. (==nil)

Now i’m looking for a way to get information about the called rake task, or is there any other working solution?

Im running Rails 2.3.10 / Ruby 1.8.7

Here’s the code from my environment.rb for better understanding:

Rails::Initializer.run do |config|

# fix for plugins dependent on gems
# see http://blog.joopp.com/2009/01/26/plugin-gem-dependencies-in-your-environmentrb/ 

if $rails_gem_installer
 # We stop the initializer to load the files from the /config/initializers dir. This is to disable the usage of plugins or gems in that code.
 puts 'Disabling the application initializers (rails_gem_installer == true)'
 class Rails::Initializer
   def load_application_initializers; end
 end

 # Next, do _only_ load the needed plugins that are not dependent on gems. For example exception_notification since that one is used in application.rb.
 puts 'Not loading all plugins (rails_gem_installer == true)'
 config.plugins = [:exception_notification]
else
 # Otherwise, when we're just loading the environment.. load everything in the right order. So this is YOUR config.plugins = [something]!
 config.plugins = [:all]
end

[... stuff like config.gem and so on]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:34:35+00:00Added an answer on May 18, 2026 at 12:34 am

    Instead of going down the road of getting rake gems:install to work properly, which was something that never seemed to work properly in every situation, it might be better to port your dependencies to bundler instead. Although this is how Rails 3 is configured by default, it can be used on any ruby project and does a much better job.

    A Gemfile also serves as a human-readable manifest of dependencies, something that’s not always easily extracted from a Rails configuration file.

    There’s an example on using bundler with Rails 2.3 on their site: http://gembundler.com/rails23.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to disable Script permission on a folder for uploads and realized if
I have tried to figure out how to disable the header for a jqGrid,
I need disable tooltip in google geo chart. I tried tooltip.trigger: 'none' and other
Can I disable the minimize button in JFrame? I have already tried setUndecorated() and
How can I disable selecting in a WPFTooklit's DataGrid ? I tried modifying the
I am trying to disable editing on my UITextView . I have tried [aboutStable
I tried to disable unnecessary context menu when I set a grid with ContextMenus.
I tried to disable an asp.net button but failed. The error: Compiler Error Message:
I have tried to disable and enable the focusing of edittext box depend on
I want to disable items in a ListView . First, I tried to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.