This project is archived and is in readonly mode.

#3774 ✓committed
marc-donovan

Gem generators are not found by script/generate

Reported by marc-donovan | January 23rd, 2010 @ 12:20 AM | in 3.0.2

cucumber generators are installed but script/generate does not find them

marc@marc-desktop:~/wk/new_app$ script/generate cucumber
Could not find generator cucumber.
marc@marc-desktop:~/wk/new_app$ script/generate
Usage:
script/generate GENERATOR [args] [options]

General options:
-h, [--help] # Print generators options and usage -p, [--pretend] # Run but do not make any changes -f, [--force] # Overwrite files that already exist -s, [--skip] # Skip files that already exist -q, [--quiet] # Supress status output

Please choose a generator below.

Rails:
app controller generator helper integration_test mailer metal migration model model_subclass observer performance_test plugin resource scaffold scaffold_controller session_migration stylesheets

ActiveRecord:
active_record:migration active_record:model active_record:observer active_record:session_migration

Erb:
erb:controller erb:mailer erb:scaffold

TestUnit:
test_unit:controller test_unit:helper test_unit:integration test_unit:mailer test_unit:model test_unit:observer test_unit:performance test_unit:plugin test_unit:scaffold

marc@marc-desktop:~/wk/new_app$ gem list --local

LOCAL GEMS

actionmailer (2.3.5, 2.3.3)
actionpack (2.3.5, 2.3.3)
activerecord (2.3.5, 2.3.3)
activeresource (2.3.5, 2.3.3)
activesupport (2.3.5, 2.3.3)
builder (2.1.2)
bundler (0.8.1)
chronic (0.2.3)
columnize (0.3.1)
cucumber (0.6.2, 0.6.1)
cucumber-rails (0.2.4, 0.2.3)
database_cleaner (0.4.3, 0.4.0)
diff-lcs (1.1.2)
factory_girl (1.2.3)
gemcutter (0.3.0)
hoe (2.5.0, 2.4.0)
hpricot (0.8.2)
httpclient (2.1.5.2)
json_pure (1.2.0)
linecache (0.43)
mail (1.6.0)
mime-types (1.16)
mysql (2.8.1, 2.7)
nokogiri (1.4.1)
polyglot (0.2.9)
rack (1.1.0, 1.0.0)
rack-test (0.5.3)
rails (2.3.5, 2.3.3)
rake (0.8.7)
rmagick (2.12.2, 2.11.0)
rspec (1.3.0, 1.2.9)
rspec-rails (1.3.2, 1.2.9)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
rubyforge (2.0.3)
rvm (0.1.1)
soap4r (1.5.8)
sqlite3-ruby (1.2.5)
term-ansicolor (1.0.4)
timecop (0.3.4)
treetop (1.4.3)
webrat (0.7.0, 0.6.0)
whenever (0.4.1)
will_paginate (2.3.12, 2.3.11)

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky June 12th, 2010 @ 11:28 AM

    • Assigned user set to “Yehuda Katz (wycats)”

    Yehuda - this is the same issue we talked about at RailsConf. The rake command and script/rails g script need bundler to load gems in the test group in order for gems like cucumber-rails and rspec-rails to expose tasks and generators via a railtie.

  • David Chelimsky

    David Chelimsky June 12th, 2010 @ 11:28 AM

    • Assigned user changed from “Yehuda Katz (wycats)” to “Carl Lerche”
  • David Chelimsky

    David Chelimsky June 12th, 2010 @ 11:46 AM

    • Assigned user changed from “Carl Lerche” to “José Valim”
  • José Valim

    José Valim June 12th, 2010 @ 11:49 AM

    Marc, first, you need to add cucumber to your Gemfile. Then, if you add the gem to the group test, you need to run generators in the same group.

    David, I'm going to discuss with Yehuda the issue. Although, unfortunately, I do not have a solution in mind.

  • TMorgan99

    TMorgan99 June 14th, 2010 @ 11:34 PM

    Is this a documentation issue?
    users have to be trained to the bundler way.

  • José Valim

    José Valim June 22nd, 2010 @ 06:34 AM

    • Milestone cleared.
    • Assigned user changed from “José Valim” to “Yehuda Katz (wycats)”
  • Jason Gignac

    Jason Gignac June 24th, 2010 @ 05:29 PM

    TMorgan - I guess, I would argue that generation isn't something that one thinks of as being specific to a particular environment - I want rails to make some new files for me, and they will exist (whether or not I access them) independent of what environment I am working in, once they are generated. So, to say 'you can only generate a cucumber test inside the test environment' seems counterintuitive - it's like saying I can only generate a model if I'm in the Development environment, and that I'd need to explicitly define that. Intuitively, generators are simply 'there', you know?

    I can understand only loading a particular set of gems for server or console, say, but for generate, my gut would say to load all the gems for all the environments, since the generated files may interact with any environment. But then, of course, you have the issue that there may be conflicting gems in one environment versus another... yeah, that sucks.

  • José Valim

    José Valim June 26th, 2010 @ 12:00 AM

    • State changed from “new” to “committed”
  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “Low”
  • jasperkennis

    jasperkennis January 26th, 2011 @ 01:40 PM

    I went trough quite a search before I found out that in order to run
    $ rails generate cucumber succesfully, you need to run
    $ rails generate cucumber:install :install

    This might be of topic a bit but does solve the issue initially submitted. Also, this had a milestone for 3.0.2 but I'm experiencing the issue in 3.0.3, and all gems are up to date. That might require some attention.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages