我正在尝试使用 rails generate 命令生成评论控制器,但它给出了一个奇怪的错误:-
$ rails generate controller comments
The name 'CommentsController' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
我已经检查过了,但我没有评论控制器。这些是我尝试过的命令:-
$ rails generate controller Comments create
The name 'CommentsController' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
$ rails generate controller comments
The name 'CommentsController' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
$ rails g controller Comments
The name 'CommentsController' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again
请帮帮我。
这是 GemFile:-
source 'http://rubygems.org'
gem 'rails', '3.2.13'
gem 'bootstrap-sass', '2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'mysql'
gem 'activeadmin'
gem "meta_search", '>= 1.1.0.pre'
gem 'formtastic'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development, :test do
gem 'rspec-rails', '~> 2.11.0'
gem 'factory_girl_rails', '~> 3.5.0'
gem 'capybara', '~> 1.1.2'
gem 'guard-rspec', '~> 1.2.0'
end
# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'