remarkable
remarkable copied to clipboard
Support Ruby 1.9.1
Running under Ruby 1.9.1 throws the exception "uninitialized constant Remarkable::ActiveRecord".
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
I had the same problem. Thanks anderscarling, your solution worked for me.
+1 for this fix, got me up and running on 1.9. Thanks!
Also add
, :require => false
to your gem file if you're using this with bundler. Like so:
gem "remarkable_rails", :require => false