Last active
August 29, 2015 14:11
-
-
Save betesh/f080b8a38ba7f476b2a0 to your computer and use it in GitHub Desktop.
rails-html-sanitizer gem breaks ActionMailer + ActionView + ActiveRecord - Rails 4.2.0 projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "active_record" | |
require "action_view/helpers" | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', dbfile: ':memory:') | |
# Alternative minimal implementation: | |
require "active_record" | |
require "action_mailer" | |
ActionMailer::Base.delivery_method = :test | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', dbfile: ':memory:') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "activerecord", "= 4.2.0" | |
gem "actionview", "= 4.2.0" | |
gem "sqlite3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle exec ruby demo.rb | |
GEM_PATH/activerecord-4.2.0/lib/active_record/connection_handling.rb:3:in `block in <module:ConnectionHandling>': undefined method `env' for Rails:Module (NoMethodError) | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/connection_handling.rb:4:in `call' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/connection_handling.rb:4:in `block in <module:ConnectionHandling>' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/connection_handling.rb:63:in `call' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/connection_handling.rb:63:in `initialize' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/core.rb:46:in `new' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/core.rb:46:in `configurations=' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/core.rb:48:in `block in <module:Core>' | |
from GEM_PATH/activesupport-4.2.0/lib/active_support/concern.rb:120:in `class_eval' | |
from GEM_PATH/activesupport-4.2.0/lib/active_support/concern.rb:120:in `append_features' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/base.rb:285:in `include' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/base.rb:285:in `<class:Base>' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/base.rb:270:in `<module:ActiveRecord>' | |
from GEM_PATH/activerecord-4.2.0/lib/active_record/base.rb:26:in `<top (required)>' | |
from demo.rb:3:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment