Thibaud Clement
Thibaud Clement

Reputation: 6897

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

I am trying to follow this Airpair tutorial by Fernando Villalobos, to play around with Rails and React through the react-rails gem.

I created a brand new Rails 4 app and I am now trying to install react-rails.

This is my 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

I already ran both bundle install and bundle update (just in case).

But, whenever I try to run rails g react:install as recommended here, I keep getting the following error:

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.

Any idea of what's wrong here?

Upvotes: 4

Views: 1702

Answers (2)

chug2k
chug2k

Reputation: 5220

Try running spring stop. You might have attached to an old process.

Upvotes: 2

Clark Teeple
Clark Teeple

Reputation: 26

I had the same problem. I just tried it again in a new rails project - without running bundle install first - and it worked.

Upvotes: 1

Related Questions