Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem not compatible with Watir-Webdriver #106

Closed
Johnesco opened this issue Dec 28, 2014 · 4 comments
Closed

Gem not compatible with Watir-Webdriver #106

Johnesco opened this issue Dec 28, 2014 · 4 comments

Comments

@Johnesco
Copy link

I've been creating scripts that included both Watir-Webdriver and your gem and until recently they have been working well together.

Recently, I found that I was not able to require "numbers_and_words" without causing a failure of Watir-Webdriver from launching a browser. I have not been able to point what was updated to cause this.

I've put all details that I can recreate on Stack Overflow.
http://stackoverflow.com/questions/27673549/why-is-numbers-and-words-gem-causing-this-error

The overlap seems to be in gems that they have in common. However I'm unable to diagnose myself if the issues is exactly where I think it is.

@eLod
Copy link
Collaborator

eLod commented Dec 28, 2014

This is likely a problem in ActiveSupport:

barnabas:~ pota$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
barnabas:~ pota$ irb
irb(main):003:0> require 'active_support/core_ext/object'; require 'active_support/version'; ActiveSupport.version
=> #<Gem::Version "4.2.0">
irb(main):004:0> {foo: :bar}.to_json
NameError: uninitialized constant ActiveSupport::JSON
    from /Users/pota/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
    from (irb):4
    from /Users/pota/.rbenv/versions/2.1.0/bin/irb:11:in `<main>'

The quick fix is to require active_support/json which solves the problem. However older versions of activesupport also seem to work this way, so either it's a bug in activesupport (not requiring active_support/json from active_support/core_ext/object/json -- or active_support/core_ext/object/to_json in older versions) or it's the intended way of working in which case i guess numbers_and_words should fix it (either requiring active_support/json or only requiring specific object core extensions we need and not all, see http://github.com/kslazarev/numbers_and_words/blob/master/lib/numbers_and_words.rb#L5). @kslazarev thoughts?

@dblock
Copy link
Collaborator

dblock commented Dec 28, 2014

Numbers_and_words isn't using any JSON-related functionality, so I think the proposal to require something smaller than active_support/core_ext/object is likely the right way to go. Try a PR?

@dblock
Copy link
Collaborator

dblock commented Mar 9, 2016

Bump, what do we want to do with this?

@Mackaber
Copy link

I'm having the same issue using Grape 0.19.2

jlduran added a commit to jlduran/numbers_and_words that referenced this issue Jun 20, 2017
This commit removes the dependency on the `ActiveSupport` gem by doing
the following:

- Replace `constantize` with `Object.const_get()`
- Remove the following `Object` methods:
    - `blank?`
    - `present?`
- Remove the following `String` methods:
    - `camelcase`
    - `titleize`
    - `underscore`

Closes kslazarev#106
jlduran added a commit to jlduran/numbers_and_words that referenced this issue Jun 20, 2017
This commit removes the dependency on the `ActiveSupport` gem by doing
the following:

- Replace `constantize` with `Object.const_get()`
- Remove the following `Object` methods:
    - `blank?`
    - `present?`
- Remove the following `String` methods:
    - `camelcase`
    - `titleize`
    - `underscore`

Closes kslazarev#106
jlduran added a commit to jlduran/numbers_and_words that referenced this issue Jun 20, 2017
This commit removes the dependency on the `ActiveSupport` gem by doing
the following:

- Replace `constantize` with `Object.const_get()`
- Remove the following `Object` methods:
    - `blank?`
    - `present?`
- Remove the following `String` methods:
    - `camelcase`
    - `titleize`
    - `underscore`

Closes kslazarev#106
jlduran added a commit to jlduran/numbers_and_words that referenced this issue Jun 20, 2017
This commit removes the dependency on the `ActiveSupport` gem by doing
the following:

- Replace `constantize` with `Object.const_get()`
- Remove the following `Object` methods:
    - `blank?`
    - `present?`
- Remove the following `String` methods:
    - `camelcase`
    - `titleize`
    - `underscore`

Closes kslazarev#106
jlduran added a commit to jlduran/numbers_and_words that referenced this issue Jun 20, 2017
This commit removes the dependency on the `ActiveSupport` gem by doing
the following:

- Replace `constantize` with `Object.const_get()`
- Remove the following `Object` methods:
    - `blank?`
    - `present?`
- Remove the following `String` methods:
    - `camelcase`
    - `titleize`
    - `underscore`

Closes kslazarev#106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants