Bundler::GemRequireError when adding gem

126 views Asked by At

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!

2

There are 2 answers

0
Loïc Boutet On BEST ANSWER

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

4
Jamie A. On

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.