This project is archived and is in readonly mode.
Gem generators are not found by script/generate
-
David Chelimsky
- Assigned user set to Yehuda Katz (wycats)
Yehuda - this is the same issue we talked about at RailsConf. The
rakecommand andscript/rails gscript 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
- Assigned user changed from Yehuda Katz (wycats) to Carl Lerche
-
David Chelimsky
- Assigned user changed from Carl Lerche to José Valim
-
José Valim
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
Is this a documentation issue?
users have to be trained to the bundler way. -
José Valim
- Milestone cleared.
- Assigned user changed from José Valim to Yehuda Katz (wycats)
-
Jason Gignac
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
- State changed from new to committed
Handled with documentation in the Gemfile:
http://github.com/rails/rails/commit/ccc8eba4dcdee9ae07788574f7cfff...
-
jasperkennis
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 :installThis 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.