Bundler and Rails Engines

We are working on a railes engine project that consists of a host application and several plugin gem engines. In both RubyMine and TeamCity this appears to be causing problems as both expect there to be a Gemfile in the root of the project checkout directory.

Sample Project Layout


Notice there is no Gemfile in the root of the project. In RubyMine or TeamCity, opening the root project directory and attempting to execute any cucumber, rake or rspec test within a sub directory will result in an error message "Error running <task>: No Gemfile found"

Attached are two example configurations for cucumber and rake profiles. Note that the working directory is set to a sub folder of the project directory structure which does contain a Gemfile and the checkbox for use Bundler is selected.

Obviously we can create a Gemfile in root which contains all of the required Gems for each sub project and host however this is not a very Dry process and should be avoided.

Anyone know of a work around or alternative solution for this?

Comment actions Permalink

Hi Jason,

you can open project containing your Host application and add all engines as additional source roots in Settings | Project structure. This should do the trick

Comment actions Permalink

Thanks for the responce Denis, that should solve the Rubymine issue.

We were able to solve the TeamCity problem by setting a build parameters. system.teamcity.rake.runner.custom.gemfile=<Gemfile Path>


Please sign in to leave a comment.