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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:31:48+00:00 2026-05-23T12:31:48+00:00

In my rails3 engine gemfile, I added: gem ‘paperclip’ gem ‘inherited_resources’ I also added

  • 0

In my rails3 engine gemfile, I added:

gem 'paperclip'
gem 'inherited_resources'

I also added this to my gemspec:

s.add_dependency "paperclip"
s.add_dependency "inherited_resources"

I then ran bundle install for both my engine and the client app and started up the console for the client app in order to first test paperclip, to which I get:

Using /Users/ynkr/.rvm/gems/ruby-1.9.2-p180 with gemset rails31beta
ynkr % rails c
/Users/ynkr/.rvm/gems/ruby-1.9.2-p180@rails31beta/gems/actionpack-3.1.0.rc4/lib/action_dispatch/http/mime_type.rb:101: warning: already initialized constant YML
Loading development environment (Rails 3.1.0.rc4)
ruby-1.9.2-p180 :001 > b=Blog::Blog.first 
  Blog::Blog Load (0.2ms)  SELECT `blogs`.* FROM `blogs` LIMIT 1
 => #<Blog::Blog id: 1, user_id: 1, context_id: 2, title: "Cmd Line Blog Title", title_for_url: "cmd-line-blog-title", teaser: "This is the teaser for the command line blog", content: "Some content for the cmd line blog", created_at: "2011-06-28 06:06:55", updated_at: "2011-06-28 06:06:55"> 
ruby-1.9.2-p180 :002 > b.photos
NoMethodError: undefined method `has_attached_file' for #<Class:0x00000102a57fc8>
    from /Users/ynkr/.rvm/gems/ruby-1.9.2-p180@rails31beta/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:1078:in `method_missing'
    from /websites/gems/blog/app/models/blog/photo.rb:6:in `<class:Photo>'
    from /websites/gems/blog/app/models/blog/photo.rb:1:in `<top (required)>'
    from /Users/ynkr/.rvm/gems/ruby-1.9.2-p180@rails31beta/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:452:in `load'

OK, so it appears the has_attached_file method from the paperclip gem cannot be found. Why? I’m not sure.

Moving on to inherited_resources, I altered a scaffold generated controller to look like the following:

class Blog::ContextsController < InheritedResources::Base
  before_filter :redirect_unless_admin
end

and load up the index page for that to which I am greeted (in the logs) with:

Started GET "/blog/contexts" for 127.0.0.1 at 2011-06-28 12:06:25 -0700

ActionController::RoutingError (uninitialized constant InheritedResources):

Rendered /Users/ynkr/.rvm/gems/ruby-1.9.2-p180@rails31beta/gems/actionpack-3.1.0.rc4/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.5ms)

My question is why are these not working? My hunch is that there is something about engines, namespacing and loading up gems that I am totally unaware of.

  • 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-23T12:31:49+00:00Added an answer on May 23, 2026 at 12:31 pm

    You need to require each gem within your engine in an initializer file, eg. lib/<your_engine_name>/engine.rb

    Bit more of an explanation over here…

    Rails Engine – Gems dependencies, how to load them into the application?

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

Sidebar

Related Questions

I have smth like this in my Gemfile gem 'plugin', :git => 'git://plugin.git' And
I have a engine style Rails plugin from which I can create a gem
I am building a rails3 web app. Is there a query like this in
I'm trying to write tests for an engine gem I'm writing. I'm using Rspec
When creating a rails engine in 2.3.5 as a plugin, how can the gem
I'm writing a modular project in Rails3, and I've this issue. I've my main
I want to write a gem that, once bundled to a Rails 3.1 Gemfile,
I am developing a Rails engine to be packaged as a gem. In my
Just out of curiosity... in my previous post Rails3.1 engine: can't get SLIM or
I have a Rails engine (someone else's gem) that I am trying to modify

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.