0

我在将 react.rb 添加到我的项目时遇到了麻烦。

起初, 在完成所有添加步骤后reactive_rails_generator,我启动了我的应用程序,我收到了错误:

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

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

应用程序/视图/布局/网格/layout.html.erb:15:

我看到所有需要 gem 的 In Gemfile 来使用 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'

任何人都可以帮忙吗?

其次,我有一个 rake 任务消息:

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

register_mime_type请使用然后使用register_compressoror注册一个 mime 类型register_transformerhttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (从 /Users/serzh/.rvm/gems/ruby 调用-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:165) 弃用警告:Sprockets 方法register_engine已弃用。register_mime_type请使用然后使用register_compressoror注册一个 mime 类型register_transformerhttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (从 /Users/serzh/.rvm/gems/ruby 调用-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:166) 弃用警告:Sprockets 方法register_engine已弃用。register_mime_type请使用然后使用register_compressoror注册一个 mime 类型register_transformerhttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors (从 /Users/serzh/.rvm/gems/ruby 调用-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/erb.rb:23)

4

2 回答 2

1

您正在使用已弃用的版本。repo 已经移动,最新版本在这里:reactrb-rails-generator

我们认为 github 是自动转发的……为混淆道歉!

于 2016-08-08T16:27:58.127 回答
0

检查此博客文章-它可能会有所帮助 https://medium.com/@yoniweisbrod/how-we-integrate-react-with-rails-at-ivy-b90f27751a00#.p2vlihlcx

于 2016-08-07T23:12:01.437 回答