1

我在使用 ActiveScaffold 和 Rails 4 时遇到了一个非常奇怪的错误。我创建了一个全新的项目,运行“rake db:create”和“bundle install”,然后将 gem active_scaffold 添加到我的 gem 文件中并再次运行“bundle install” . 此时一切正常。

然后,当我尝试输入时:

rails g active_scaffold Test test:string

我得到:

/Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247/gems/active_scaffold-3.2.20/lib/active_scaffold.rb:2:in `<top (required)>': This version of ActiveScaffold requires Rails 3.1 or higher.  Please use an earlier version. (RuntimeError)
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/rgrzesik/Documents/Rails_Projects/FingertipFormulary/config/application.rb:7:in `<top (required)>'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
from /Users/rgrzesik/.rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

是什么赋予了?我正在运行 Rails 4,它远远超出了 Rails 3.1。有任何想法吗?

4

1 回答 1

2

看起来还没有发布版本包含该 Rails 4 支持。您可以随时使用来自 github 的当前版本来试试运气:gem 'active_scaffold', github: 'activescaffold/active_scaffold', branch: 'master'

然后,您可以密切关注 3.4.0 的发布。与此同时,你会不断地从主分支获得最新的东西(可能是坏的,或者至少不是“保证满意”)。

于 2013-10-23T21:41:26.023 回答