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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:32:03+00:00 2026-05-20T03:32:03+00:00

tldr; When I run a rake task in a test app which uses an

  • 0

tldr; When I run a rake task in a test app which uses an Engine, the Engine dependencies don’t seem to be respected. I have to (-D)RY by specifying the dependency in the test app’s Gemfile

I’ve created a Rails Engine as a gem using Jeweler. It has a dependency on Devise which I’ve specified in the Rakefile:

gem.add_runtime_dependency 'devise', '~> 1.1.3'

In my test app I add the Engine dependency to the Gemfile, and bundle install shows that Devise is picked up and installed. However if I run an initial rake db:migrate an error is thrown:

uninitialized constant Devise
<snip>config/initializers/devise.rb:3

If I manually add the Devise dependency to the test app’s Gemfile it works. I’ve probably missed something obvious, but at this stage it appears the test app picks up and installs the dependency properly, but for some reason the initializer code fails unless the dependency is listed again in the test app’s Gemfile.

  • 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-20T03:32:03+00:00Added an answer on May 20, 2026 at 3:32 am

    You’re likely to have found a solution or a workaround, but I’ll put how I solved this in case someone has the same problem.

    Just put:

    require 'devise'
    

    in lib/my_gem.rb .

    Rails autoloads the gems specified in the Gemfile and nothing else. If you’re developing a gem that has dependencies, you have to require them manually.

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

Sidebar

Related Questions

TLDR I have a function that runs on the end of a pan in
I have a user defined function in a SQL Server 2005 database which returns
TLDR: if I built a multipurpose parser by hand with different code for each
TLDR I need to change a javascript variable on the same page after clicking
It's rather lengthy, TLDR version below crit wall of text. Setup : Our company
My app is highly data driven, and needs to be frequently updated. Currently the
TLDR: What are the pros/cons of using an in-memory database vs locks and concurrent
TLDR: Started with this question simplified it after got some of it working and
TLDR IE is still caching my requests even with Math.random() included in the URL.
TLDR version: Most important issue is, that in a TSP problem, instead of finding

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.