Rails 4 + react-rails gem: 找不到生成器 'react:install'

Rails 4 + react-rails gem: Could not find generator 'react:install'

我正在尝试跟随 Fernando Villalobos 的 this Airpair tutorial,与 Rails 一起玩耍,并通过 react-rails gem.

我创建了一个新的 运行d Rails 4 应用程序,我现在正在尝试安装 react-rails

这是我的 Gemfile:

source 'https://rubygems.org'

gem 'rails', '4.2.2'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'bootstrap-sass'
gem 'react-rails', '~> 1.4.0'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

我已经 运行 bundle installbundle update (以防万一)。

但是,每当我尝试 运行 rails g react:install as recommended here 时,我总是收到以下错误:

Could not find generator 'react:install'. Maybe you meant 'test_unit:job' or 'test_unit:model' or 'generator'
Run `rails generate --help` for more options.

知道这里出了什么问题吗?

我遇到了同样的问题。我刚刚在一个新的 rails 项目中再次尝试 - 没有先安装 运行 bundle - 它成功了。

试试 运行 spring stop。您可能已附加到旧进程。