0

I'm including a few local engines from within my Rails app into the app's Gemfile

# In the Gemfile...
# Bundles an internal engine from ./engines into the Gemfile and
# loads the engine's dependencies from the .gemspec file
def load_engine(gem_name, dirname = nil)
  dirname ||= gem_name
  # Load the engine into the app
  gem gem_name, path: "engines/#{dirname}"
  # Include the engine's dependencies
  gemspec path: "engines/#{dirname}/"  
end

# Load engines
load_engine('engine_one')
load_engine('engine_two')

When I run bundle commands I get the following warning in the console:

Your Gemfile lists the gem engine_one (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem engine_two (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.

Can anybody explain what's going on here?

bodacious
  • 6,608
  • 9
  • 45
  • 74
  • As you're not passing a directory surely it's loading in the same engine and gemspec and I assume that the gemspec has the name engine_one defined within it? – j-dexx May 19 '14 at 13:30
  • I worked this out - I don't have to load the gemspec because the dependences are already included with the gem. Duh. – bodacious May 19 '14 at 15:33

0 Answers0