Skip to content

Instantly share code, notes, and snippets.

@rsutphin

rsutphin/script.md

Created Mar 19, 2010
Embed
What would you like to do?
Script to reproduce bundler issue 210

Generate app

$ rails -m http://gist.github.com/raw/338169/3a1d8e8eb1dde41479d2606019c0df031df7d872/rails23-bundler-template.rb foo
$ cd foo

Add a gem which provides generators to the Gemfile

source :gemcutter
gem 'rails', '2.3.5', :require => nil
gem 'sqlite3-ruby'
gem 'rspec-rails'

Install

$ bundle install --relock

Try to use one of the generators

$ script/generate rspec_model bar
Couldn't find 'rspec_model' generator
$ bundle exec script/generate rspec_model bar
Couldn't find 'rspec_model' generator
$ bundle exec bash
$ script/generate rspec_model bar
Couldn't find 'rspec_model' generator
$ exit

Install generator-providing gem at system level and try again

$ sudo gem install rspec-rails
$ script/generate rspec_model bar
      exists  app/models/
      create  spec/models/
      create  spec/fixtures/
      create  app/models/bar.rb
      create  spec/models/bar_spec.rb
      create  spec/fixtures/bars.yml
      create  db/migrate
      create  db/migrate/20100319211452_create_bars.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment