2010-04-07 50 views
0

所以我想使用Ryan Bates的Nifty Generators的rails3分支。现在我已经使用这个宝石之前与beta1和它的工作,但升级到beta2后,我得到了一个非常粗糙的错误。Rails :: Generators :: Rails 3.0.0.beta2问题:: GeneratedAttribute

lib/generators/nifty/scaffold/scaffold_generator.rb:35:in `block in initialize': uninitialized constant Rails::Generators::GeneratedAttribute (NameError) 

的代码peice的地方出现这种情况:

args_for_c_m.each do |arg| 
    if arg == '!' 
    options[:invert] = true 
    elsif arg.include?(':') 
    @model_attributes << Rails::Generators::GeneratedAttribute.new(*arg.split(':')) 
    else 
    @controller_actions << arg 
    @controller_actions << 'create' if arg == 'new' 
    @controller_actions << 'update' if arg == 'edit' 
    end 
end 

现在,我已经看到了GeneratedAttribute在许多宝石使用前,所以我为什么崩断的困惑。我不确定,但我认为这与测试版2有关。

所以我的问题是这是一个Rails的问题,在我的一端?如果它在我的头上有什么想法我可能做错了?

谢谢。

回答

1

可能是beta2 bug或rails不会自动加载该模块了。尝试加入

require 'rails/generators/generated_attribute' 
+0

我去了rails控制台并做了一个快速的“require'rails/generators/generated_attribute'”,它返回nil。所以我认为这也不会起作用。 – 2010-04-07 17:48:57

+0

说得太快!有效!谢谢! – 2010-04-07 17:51:09