How do I get the generators list?
I'm using a MacBook Pro, and can't get the list of generators. The shortcut is alt-insert, but there is no insert key on a MacBook Pro. I can't find a menu to bring up the generators, and I can't find a way to change the shortcut key.
Hope someine can help!
请先登录再写评论。
Ok, I got that bit sorted.
In the keymapping, I changes to a different mapping. It means I can't have my preferred mapping because the 'Add shortcut' button never seems to be enabled, but at least I can bring up the popup.
Nowever, it leads to another issue.
I was trying to bring up the generate popup to select 'Seto Cucumber Support', but this option is not in the list.
I have the cucmber gem installed, and and have attached the gem in the prefrences dialogue. I've restarted Ruby mine, and can't see any warnings anywhere, but this option is not present.
Any ideas?
Right. Got it.
The help page says to reload Rake Tasks after activiating the Gem. It should say reload generators.
If I reload generators I get the option.
Alt+insert is on Windows, on Mac use ^+N or in context menu in project view
"Setup cucumber support" option will invoke "cucumber" generator. This generator creates necessary files for cucumber support in rails application

Reloading is necessary only after installing new gems/rails plugins or after changing Rakefile.
I'm still having huge trouble with this.
After having got it working on one project, with the trial, I bought a license. I applied the license to the same installation of RubyMine as I had the cucumber plugin working for.
I've created a new project, and the cucumber gem is no longer listed as being installed.
So, I've gone through the install process process again, and attached the gem to my new project, but now no matter what I do, I cannot get the generator to show up.
The project is brand new, and so does not have cucumber already activated, the gem is listed in the attached gems on the project, but it just will not present the menu option.
Anyone have any ideas?
Hi Phil,
1. Try "RubyMine | Tools | Reload Generators" action.
2. After background process will be finished check that RubyMine doesn't show any errors in "Messages" window
What do you mean? "Installed" or "attached"? Gem is installed if it is installed in rubygems using RubyMine or console. "Attach" is notion related only to RubyMine code insight. To avoid parsing and keeping in memory unused gems RubyMine supports gems which are "attached" to project in RubyMine | File | Settings | Ruby SDK and Gems. Also if rspec or cucumber rails plugins are installed it isn't necessary to attach corresponding gems in RubyMine's Gem manager
3. Also please execute following command in console and me show output
Hi,
Thanks for respknding so promptly.
Basically, I'm trying to follow the instructions in the RubyMine help.
I have the cucmber Gem installed in my ruby installation, and have been able to use it from the command line.
However, the cucmber Gem did not show in the list of gems in the Project Settings | Ruby SDK and Gems dialogue. So, I installed the gem in there by clicking the 'Install Gems' button. I then clicked the 'Attache Gems' button, and selected the cucmber Gem. Thats what I meant by 'installed and attached'.
After doing this, I have selected 'Reload Rake Tasks' as it says to do in the help file.
I have also selected 'Reload Generators'. Both of these tasks complete without errors.
However, when I press ^N (on a Mac), the list of genertors does not include the 'Setup Cucumber Support' option.
I have restarted RubyMine, and selected the 'Reload' options several times, but to no avail.
Please note that I have been using cucumber from the command line for quite a while with no issues. I have pnly one Ruby environment, and I have checked that the Ruby SDK in my Project Settings is that one that I expect (as there is only one anyway).
Here is the output of .script/generate:
phil$ ./script/generate
:Warning: Gem::SourceIndex#search support for Regexp patterns is deprecated
Usage: ./script/generate generator [options] [args]
Rails Info:
-v, --version Show the Rails version number and quit.
-h, --help Show this help message and quit.
General Options:
-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 Suppress normal output.
-t, --backtrace Debugging: show backtrace on errors.
-c, --svn Modify files with subversion. (Note: svn must be in path)
Installed Generators
Vendor: access_control
Builtin: controller, integration_test, mailer, migration, model, observer, plugin, resource, scaffold, scaffold_resource, session_migration, web_service
More are available at http://rubyonrails.org/show/Generators
1. Download, for example, login_generator.zip
2. Unzip to directory /Users/phil/.rails/generators/login
to use the generator with all your Rails apps
or to /Users/phil/devel/workspaces/rubymine/tracker/generators/login
to use with this app only.
3. Run generate with no arguments for usage information
./script/generate login
Generator gems are also available:
1. gem search -r generator
2. gem install login_generator
3. ./script/generate login
The Installed Generators, you will see, does not include cucmber.
Many thanks
Phil
Probably that's why RubyMine also doesn't show cucumber("Setup Cucumber support") generator.
And where is interpreter located (which ruby) ? Also please show first line of "./script/generate" script. Do you use bundled in MacOS /usr/bin/ruby or you uninstalled it manually and use something like /opt/local/bin/ruby ?
"Ruby SDK and Gems" show only attached gems, all of your installed gems should be available in dialog for "Attach Gems..." button
Please also execute command
Again, many thanks for your help.
Here's a brief console session I just did:
phil$ which ruby
/opt/local/bin/ruby
phil$ ruby --version
ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-darwin9]
phil$ which gem
/opt/local/bin/gem
phil$ gem --version
1.3.4
phil$ gem list --local | grep cucumber
cucumber (0.3.11)
phil$ cat script/generate
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate'
Cheers
Phil
1.
I suppose that two interpreters are installed on your computer: "/opt/local/bin/ruby" and "/usr/bin/ruby"
Are you sure that "/opt/local/bin/ruby" is selected as Ruby SDK? Please check it again
2. please execute in console "ruby ./script/generate"( in last our attempt you ran "./script/generate" and probably script was executed using bundled /usr/bin/ruby interpreter)
HI,
Thanks. You've brought to light a deper isue with my machine.
In my absence, someone has installed another ruby interpreter, and in fact, this is not the the only problem I am having.
I'll get my machine straightened out and see what happens then.
Thanks for your help.
I'm not sure that you understand me right. "/usr/bin/ruby" interpreter (ruby 1.8.6) is bundled in MacOS Leopard. All people with Leopard have this ruby interpreter. Many people prefer to install ruby 1.8.7 or ruby 1.9 manually so the usually use MacPorts and install ruby with interpretes located at /opt/local/bin/ruby or /opt/local/bin/ruby19.
Yes I think I do understand.
Late last week another developer used my Mac because his went in for repair.
In the meanwhile, he installed ruby 1.8.7 using macports.
He also uninstalled (I have now doscovered) several versions of the rails gem so that his project picked up the right version (instead of defining the right version in environment.rb).
So, I thought I had one ruby interpreter, 1.8.6, preinstalled and rails 2.3.2, 2.0.2, and 1.2.3.
In fact, I now had a complete mess.
I have no rebuilt my machine up to my epectations, and everythign is working fine. The problen with the cucumber gem was that I now only had rails 1.2.3 (and the environment.rb in my project specifies no version), and cucumber does not support that rails version.
I have reinstalled the 2.3.2 gem, and everything is now ok.
Sorry to have wasted your time, I should have checked this out earlier. I will be having some words with my colleague...
No problem, develop with pleasure !