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

  • Home
  • SEARCH
  • 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 3662598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:26:04+00:00 2026-05-19T01:26:04+00:00

I just created a new gem (using bundler) and want to add Active Record

  • 0

I just created a new gem (using bundler) and want to add Active Record support. So I added s.add_dependency "activerecord", "~> 3.0" to my gemspec. Then I use Bundler.setup and Bundler.require and thought that I have access to Active Record now, but I haven’t. I have to explicitly use require "active_record". Any idea why Bundler.require does not work for me in that case?

  • 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-19T01:26:05+00:00Added an answer on May 19, 2026 at 1:26 am

    Firstly, if you’re packaging a gem, do not use Bundler.require. Bundler.require is for apps not gems.

    • In .gemspec, specify the dependencies of your deployed gem.

    • In your Gemfile, include the line gemspec to automatically include the dependencies listed in your .gemspec in your Gemfile.

      You may also optionally create gem groups for dev and test.

    • In your code, explicitly require any libraries you need.

    I lost a couple of hours on this today so I hope this helps.

    (Sources 1, 2)

    Secondly, though the ActiveRecord gem is called “activerecord”, the lib is called “active_record”. This is what you would need in Gemfile.

    gem 'activerecord', :require => "active_record"
    

    Unless you include the :require option, ActiveRecord won’t be loaded correctly and you won’t know about it until you try to use it.

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

Sidebar

Related Questions

I just created a new Maven project using the default archetype and added the
I've just created a new Windows XP VM on my Mac using VMware Fusion.
I've just created a new data service using the WCF Data Services 4.1 CTP2
I am using Rails 2.3 and I decided to provide support for JSONP. Created
In my PDBComponent class's header file, I just created a new constructor for a
I just created an action filter that I want to apply to nearly all
So I just created a new project and app for the blog. When I
I've just created a new website and am ready to switch from an my
I have 2 tables: Person and Item. I just created a new column in
I have just created an Ubuntu virtual machine for web development and I want

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.