nifty-generators
nifty-generators copied to clipboard
NetBeans 6.9.1 - Noob doing something wrong.
I've just started web development having done desktop development for several years. I'm obviously doing something wrong but I can't seem to get the nifty-generators to work.
I've got the gem; It's in my gem list. None of the commands seem to work.
I've added gem "nifty-generators", :group => :development to the gem file.
If I run: rails g nifty:scaffold Recipe name:string index new from the rails console inside netbeans: I get:
SyntaxError: (irb):2: syntax error, unexpected tCONSTANT, expecting keyword_do or '{' or '(' rails g nifty:scaffold Recipe name:string index new ^ (irb):2: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' rails g nifty:scaffold Recipe name:string index new ^ from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:44:in `start' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands/console.rb:8:in `start' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:23:in `' from script/rails:6:in `require'
If I run rails g nifty:authentication it from a command prompt in windows I get:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/depen dencies.rb:239:in `require': no such file to load -- generators/nifty (LoadError ) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `block in require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `block in load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:596:in `new_constants_in' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `require' from C:/Apps/RAILS/Twitterate/lib/generators/nifty/authentication/authen tication_generator.rb:1:in `' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `block in require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `block in load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:596:in `new_constants_in' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:286:in `block (2 levels) in lookup' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:282:in `each' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:282:in `block in lookup' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:281:in `each' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:281:in `lookup' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:141:in `find_by_namespace' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/genera tors.rb:161:in `invoke' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman ds/generate.rb:10:in ` ' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `block in require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `block in load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:596:in `new_constants_in' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:225:in `load_dependency' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_ support/dependencies.rb:239:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman ds.rb:17:in ` ' from script/rails:6:in `require' from script/rails:6:in ` ' from script/rails:6:in ` '
It loks like the problem I was having with the system variables when I first installed ruby but I've followed the set up to the letter.
Any help would be appreciated.
Also, If I run the generator from inside NetBeans, i.e. right click the project and select generate, It starts to generate but stops saying that nifty-generator is a rails 2.x generator and is not supported.
Thank you
Hmm, if you tried running it in the console and you still get an error then the error probably isn't specific to Nifty Generators. Do you know if you are using the latest version of Nifty Generators? Version 0.4.5. Maybe it is picking up an old release.
Other then that I'm not sure what the issue could be, I haven't seen it before and assume it is Windows specific. I'll mark this for help so hopefully others with Windows experience can chime in.
I'm not sure why NetBeans is saying it's a Rails 2 generator. It includes both a Rails 2 and Rails 3 generator so maybe it just doesn't like that.
If this issue is still unresolved, try running those same commands from the windows command prompt in your project folder. I'm using netbeans as well but I never use the netbeans console. I know that netbeans defaults its ruby interpreter to the JRuby interpreter, which could be causing issues?
Try checking Tools -> Ruby Platforms
. If you only have th JRuby interpreter, you can try installing from this page: http://rubyonrails.org/download
As a side note, I switched from Windows/Netbeans to Ubuntu/Netbeans (I dual boot so I kept Windows for my non-development usage). I found one gotcha after another while trying to develop my first Rails app in Windows.