0

I have a trouble with adding react.rb to my project.

At first, after all steps with adding reactive_rails_generator is done, and i started my app, i have got the error:

ActionView::Template::Error (undefined method `load_asset' for Opal::Sprockets:Module):

<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

app/views/layouts/grid/layout.html.erb:15:

I see all need gem's In Gemfile to work with react.rb

gem 'reactive-ruby' gem 'react-rails', '~> 1.3.0' gem 'opal-rails' gem 'therubyracer', platforms: :ruby gem 'react-router-rails', '~>0.13.3' gem 'reactive-router' gem 'reactive-record'

Can anyone help with that?

At second, i have a rake task message:

Warning:[rake --tasks] DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.

Please register a mime type using register_mime_type then use register_compressor or register_transformer. https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:165) DEPRECATION WARNING: Sprockets method register_engine is deprecated. Please register a mime type using register_mime_type then use register_compressor or register_transformer. https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:166) DEPRECATION WARNING: Sprockets method register_engine is deprecated. Please register a mime type using register_mime_type then use register_compressor or register_transformer. https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/erb.rb:23)

Serzh
  • 27
  • 6
  • I am recently playing with react and rails. I used `gem 'react-rails'` gem. But why did you include all those others gems? – Arup Rakshit Aug 07 '16 at 20:47
  • Look [this tutorial](https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers) to see how the author did the set up. – Arup Rakshit Aug 07 '16 at 20:48
  • @ArupRakshit Well, because i'm trying to use [react.rb](http://reactrb.org), not only react-rails gem. – Serzh Aug 07 '16 at 21:03
  • Hmm, I didn't know that. It is something I need to check. – Arup Rakshit Aug 07 '16 at 21:05
  • @ArupRakshit, and all here. I have added the issue with this little bug in `reactive-rails-generator` [here](https://github.com/loicboutet/reactive-rails-generator/issues/8). So, after adding to Gemfile `gem 'sprockets'`, everything works good! – Serzh Aug 07 '16 at 21:39

2 Answers2

1

You are using a deprecated version. The repo has moved, and the up to date version is here: reactrb-rails-generator

We thought github was automatically forwarding... Apologies for the confusion!

Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29
0

check this this blog post - it may help https://medium.com/@yoniweisbrod/how-we-integrate-react-with-rails-at-ivy-b90f27751a00#.p2vlihlcx

Guy Dubrovski
  • 1,542
  • 1
  • 20
  • 25
  • 1
    Guy - nice blog post but the question is about reactrb which your post does not address (but you should look into reactrb :-) – Mitch VanDuyn Aug 08 '16 at 16:32