remarkable icon indicating copy to clipboard operation
remarkable copied to clipboard

Support Ruby 1.9.1

Open ihoka opened this issue 15 years ago • 4 comments

Running under Ruby 1.9.1 throws the exception "uninitialized constant Remarkable::ActiveRecord".

ihoka avatar Feb 10 '10 16:02 ihoka

The issue seems to be caused by Ruby 1.9's introduction of a second optional argument to Module#const_defined? which makes Remarkable.const_defined?('ActiveRecord') (in lib/remarkable_rails/active_orm.rb:17) include ancestors by default and thus returning true when it finds ::ActiveRecord. When I checked in ./script/console, require 'remarkable_rails'; Remarkable.const_defined?('ActiveRecord', false) seemed to return false as expected.

This is the workaround I used: Add to you spec/spec_helper.rb before require 'remarkable_rails': require 'remarkable_activerecord'

You could also add this to your config/environments/test.rb, though it's not strictly needed (in my environment): add "config.gem "remarkable_activerecord", :lib => false

anderscarling avatar Apr 28 '10 12:04 anderscarling

I had the same problem. Thanks anderscarling, your solution worked for me.

lukerandall avatar May 05 '10 15:05 lukerandall

+1 for this fix, got me up and running on 1.9. Thanks!

robertwahler avatar May 06 '10 21:05 robertwahler

Also add

, :require => false

to your gem file if you're using this with bundler. Like so:

gem "remarkable_rails", :require => false

joergd avatar Mar 07 '13 11:03 joergd