React-rails: couldn't run rails g react:install

Created on 10 Feb 2016  路  6Comments  路  Source: reactjs/react-rails

Hi there,

I initialized new app and want to use react. I was folowing instructions, when faced the problem. When I'm running rails generate react:install nothing heppens. My terminal just struck and I must suspend this operation to get my terminal works again. No errors and nothing happens. I have no idea what the problem and I've double checked my gems.

Thats my gemfile

source 'https://rubygems.org'
gem 'rails', '4.2.5.1'
gem 'pg', '~> 0.15'
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 'bootstrap_form'
gem 'slim-rails'
gem 'less-rails'
gem 'therubyracer'
gem 'react-rails'

group :development, :test do
  gem 'byebug'
end

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

My app is empty. So if this script just adds directory and manifest, so may be I can do it myself?

Most helpful comment

I had the same problem. I created a new Rails 5.0.1 app with nothing in it. Bundle installed the react-rails gem and tried to run rails g react:install. Terminal just hung. In my case, it had to do with Spring. After running spring stop in the terminal, I was able to run the generator. See this issue.

All 6 comments

So if this script just adds directory and manifest, so may be I can do it myself?

Yep, you can definitely just do it yourself.

I wonder what could be stuck!?

I wonder what could be stuck!?

I'm not so good at English:) I meant that my terminal is trying to process the script but nothing happens until you suspend the process.

Yep, you can definitely just do it yourself.

Sorry. But could you help me find the manifest that i should add?

The readme describes what react:install does, I think this is a complete list:

Next, run the installation script:

rails g react:install

This will:

  • create a components.js manifest file and a app/assets/javascripts/components/ directory, where you will put your components
  • place the following in your application.js:
//= require react
//= require react_ujs
//= require components

You could just add your own components.js & add those //= requires to your application.js

Thank you a lot!

I had the same problem. I created a new Rails 5.0.1 app with nothing in it. Bundle installed the react-rails gem and tried to run rails g react:install. Terminal just hung. In my case, it had to do with Spring. After running spring stop in the terminal, I was able to run the generator. See this issue.

@tomatoturnip Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FreeApophis picture FreeApophis  路  4Comments

dongtong picture dongtong  路  3Comments

adoseofjess picture adoseofjess  路  4Comments

chrismv48 picture chrismv48  路  3Comments

axhamre picture axhamre  路  3Comments