Skip to content

bundle install does not work from rails generator #3153

@tanraya

Description

@tanraya

How to reproduce this:

$ rails new testapp
$ cd ./testapp
$ rails g generator somegen

Then change generator to this:

class SomegenGenerator < Rails::Generators::Base
 source_root File.expand_path('../templates', __FILE__)

 def install
   gem "unicorn"
   run "bundle install"
 end
end

And then run generator:

$ rails g somegen

This will generate output:

 gemfile  unicorn
 run      bundle install

Could not find gem 'unicorn (>= 0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

I'm using ruby 1.9.2, Rails 3.1, RVM, Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions