Ruby on rails 4 Rails:可以在Rails 4.2.6中使用active_scoffold gem吗
我在运行时安装了gemRuby on rails 4 Rails:可以在Rails 4.2.6中使用active_scoffold gem吗,ruby-on-rails-4,Ruby On Rails 4,我在运行时安装了gem rails g active_scaffold:install 上面说 通过过程6001中的弹簧预紧器运行 找不到生成器“scoffold”。也许你的意思是“脚手架”、“css:scaffold”或“erb:scaffold” 运行rails generate--help,了解更多选项 gemfile gem 'jquery-rails' # Turbolinks makes following links in your web application faster.
rails g active_scaffold:install
上面说
通过过程6001中的弹簧预紧器运行找不到生成器“scoffold”。也许你的意思是“脚手架”、“css:scaffold”或“erb:scaffold” 运行rails generate--help,了解更多选项 gemfile
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'active_scaffold', github: 'activescaffold/active_scaffold', branch: 'master'
我找到了解决办法
我更改了安装gem的步骤,步骤如下
1.在gem文件中插入gem,gem'active_scaffold'并运行bundle install
2.运行命令“rails g active\u scaffold用户名:string”
3.在gemfile中,将gem'active\u scaffold'更改为“gem'active\u scaffold”,github:'activescaffold/active\u scaffold',branch:'master',然后再次安装包
4.通过“bundle exec rake DB:Create”创建数据库
5.运行“rails g active_脚手架:安装”
6.最后迁移它“rake db:migrate”,它说“Rails>=4.0.5受支持,ruby>=2.0受支持”,所以它应该可以工作。您是否运行了
bundle install
?我在运行命令“rails g active_scaffold User name:string”时运行了bundle,它表示已定义的错误您是否在rails g active_scaffold User name:string
之前运行了bundle exec rake db:create
?我运行了该命令,但该命令仍然表示错误我得到了解决方案,我在另一个过程中运行了它们定义的命令