Ruby on rails 未初始化的常量Rails::Generator::GeneratedAttribute::ActiveRecord
使用rails 2.3.5,当我尝试运行命令:Ruby on rails 未初始化的常量Rails::Generator::GeneratedAttribute::ActiveRecord,ruby-on-rails,scaffolding,ruby-on-rails-2,Ruby On Rails,Scaffolding,Ruby On Rails 2,使用rails 2.3.5,当我尝试运行命令:script/generate scaffold user\u name:string email:string,我得到了错误: uninitialized constant Rails::Generator::GeneratedAttribute::ActiveRecord 我搜索了这个错误,发现唯一的解决办法是在我的环境中取消对这一行的注释。rb config.frameworks -= [ :active_record, :active_re
script/generate scaffold user\u name:string email:string
,我得到了错误:
uninitialized constant Rails::Generator::GeneratedAttribute::ActiveRecord
我搜索了这个错误,发现唯一的解决办法是在我的环境中取消对这一行的注释。rb
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
在我的环境中已经没有注释。我能做什么呢?一个新手的错:),我来自rails 3,我安装了bundle,以便能够在我的rails 2项目中安装gems,但我不知道如果使用bundler,我应该再次对上面的行进行注释,因为在添加bundler的说明中没有提到
在评论\config.frameworks-=[:active\u record,:active\u resource,:action\u mailer]
然后我得到了以下信息
➜ ~ script/generate scaffold user user_name:string email:string
exists app/models/
exists app/controllers/
exists app/helpers/
exists app/views/users
exists app/views/layouts/
exists test/functional/
exists test/unit/
exists test/unit/helpers/
exists public/stylesheets/
overwrite app/views/users/index.html.erb? (enter "h" for help) [Ynaqdh] y
force app/views/users/index.html.erb
create app/views/users/show.html.erb
create app/views/users/new.html.erb
create app/views/users/edit.html.erb
create app/views/layouts/users.html.erb
create public/stylesheets/scaffold.css
create app/controllers/users_controller.rb
create test/functional/users_controller_test.rb
create app/helpers/users_helper.rb
create test/unit/helpers/users_helper_test.rb
route map.resources :users
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
create db/migrate
create db/migrate/20130820214343_create_users.rb
而且
rake db:migrate
已经完成,这意味着现在一切都好了?这是一个困难的问题,2.3.5 rails可能会有问题,也可能是因为您没有使用bundle exec,但可能性较小。我不得不说,要解决这个问题,我需要看到你回来跟踪,告诉你更多。考虑到2.3.5版本中存在一些安全漏洞,我会首先尝试更新到2.3.18。一个新手的错误:),我来自rails 3,我已经安装了bundle,以便能够在我的rails 2项目中安装gems,但我不知道在使用bundler的情况下,我应该再次评论前一行,因为在添加bundler的说明中没有提到。请查看我的答案,告诉我这是否正确