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 7904235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:57:56+00:00 2026-06-03T09:57:56+00:00

This question is about bundler,rubygems & how does it figure out which method I

  • 0

This question is about bundler,rubygems & how does it figure out which method I am calling. Its quite long, so please bear with me.

As per my understanding, Bundler is a dependency management tool for managing gems for ruby. It install all the gems & their dependencies listed in the Gemfile.

The question I want to ask can be best illustrated by an example. so here–> In my rails app I am doing this in my controller:-

module SurveyorControllerCustomMethods
  def create
    super
  end
end
class SurveyorController < ApplicationController
   include Surveyor::SurveyorControllerMethods
end

Here, I am doing two things:

  1. Include SurveyorControllerMethods from Surveyor gem.
  2. As I have used super here, it would call create method from
    SurveyorControllerMethods which works just fine but I do not
    understand it.

and the gem is installed at

$ bundle show surveyor
/home/gaurish/.rvm/gems/ruby-1.9.3-p194/gems/surveyor-0.22.0

Which surprisingly is NOT present in ruby’s $LOAD_PATH. so question is:

  1. how does it even work?
  2. Install a gem using bundler, what happens behind the scenes during install?
  3. there are some gems ex jquery-rails for which we even don’t have to include/call them in our code & yet, jQuery JavaScript file is automatically included. I know its not magic, so how does this work?
  • 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-06-03T09:57:57+00:00Added an answer on June 3, 2026 at 9:57 am

    They key is actually in how Rails is set up out of the box. Which is also one of the reasons Rails is so slow to start on larger projects.[1]

    In boot.rb you’ll find:

    require 'bunder/setup'
    

    and at the top of application.rb you’ll find:

    Bundler.require(:default, :development)
    

    This last method call looks back to your Gemfile, then iterates all of the gems that are in the given groups (:default and :development in the above). It then takes a stab at determining what the default file is that should be loaded, which is typically the gem name, but can also be specified by a :require option. Bundler has some built-in naming convention exceptions too, such as the handling of “-” instead of “_”.

    Bundler then just loads the primary file for the gem, which in turn (typically) loads the files inside the gem.

    The 'bundler/setup' file performs Bundler.setup, which takes care of the load path. It prepends (unshifts) to the $LOAD_PATH for each gem. The actual information about what those loads paths should be comes from rubygems.

    Take a look at the source in:

    https://github.com/carlhuda/bundler/blob/master/lib/bundler/setup.rb
    https://github.com/carlhuda/bundler/blob/master/lib/bundler/runtime.rb

    [1]: When you start a new Rails project, you’ll probably find it doesn’t get so slow over time if you delete the Bundler.require line and just require gems as they are needed.

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

Sidebar

Related Questions

Followed this question about delayed_job and monit Its working on my development machine. But
JD Long helped me with this: question about manual annotation . But is it
A quick question about saving data in symfony 2. I have this method (just
(This is really a newbie question about Rake & Rails & dependencies in general.
This is closely related to my previous question , which was about using CMake
This question about Timers for windows services got me thinking: Say I have (and
I have seen this question about deploying to WebSphere using the WAS ant tasks.
Follow up to this question about GNU make : I've got a directory, flac
This is sort of the Java analogue of this question about C# . Suppose
A few days ago I asked this question about jquery ajax function invoking action

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.