1

When I make a new Rails project, add gem 'reactive-record', and run rails server, I get a Bundler error: There was an error while trying to load the gem 'reactive-record'. (Bundler::GemRequireError).

What gives? I have Rails 4.2.5 and Ruby 2.1.2.

Cheers!

Jamie A.
  • 85
  • 1
  • 7

2 Answers2

2

The latest version of the generator should work very well with the help of Mitch. We collaborated together to make a generator in order to simplify greatly the installation of react.rb and reactive-record.

You should be able to get up and running by adding to your gem file :
gem 'reactive_rails_generator'

Then do a bundle install

and finally :
rails g reactrb:install --all bundle update

Will install you reactrb, reactive-record and reactive-router. Once installed, you can create components by doing : rails g reactrb:component Home::Show

1

I worked around the problem like this:

  1. Set rvm to use Ruby 2.2.2 and Rails 4.2.4.
  2. Download https://codeload.github.com/catprintlabs/reactive-record/zip/master
  3. Edited reactive-record-master/Gemfile to read:

    gem 'reactive-ruby'
    gem 'opal'
    gem 'opal-browser'
    gem 'react-rails'
    
  4. cd reactive-record-master/spec/test_app

  5. bundle install
  6. rails server

This seemed to work.

Then, I made a new Rails 4.2.4 project. Adding only gem 'reactive-record' to the Gemfile resulted in the same error. Then I made the Gemfile read:

gem 'reactive-ruby'
gem 'opal'
gem 'opal-browser'
gem 'react-rails'
gem 'reactive-record'

And voila, rails server works!

Hope this helps someone else.

Jamie A.
  • 85
  • 1
  • 7
  • Jamie - thanks a lot... fyi there should be a rails generator for react.rb and reactive-record out there shortly. We will be sure to incorporate your suggestion to make sure it all works. – Mitch VanDuyn Jan 23 '16 at 13:03
  • @MitchVanDuyn Oh gosh I would love a generator :) I'm still having trouble getting my full stack going and will be posting another question here shortly... that would be resolved if a generator existed. – Jamie A. Jan 23 '16 at 16:20
  • Okay well hopefully we should have something up for you to try in under an hour...check in https://gitter.im/zetachang/react.rb I will post any updates there first – Mitch VanDuyn Jan 23 '16 at 16:25
  • see my answer below... a preliminary version is working and available. – Mitch VanDuyn Jan 23 '16 at 20:56