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

Error when running in node.js project: undefined method `downcase' for ["type", "BSD"]:Array (NoMethodError) #108

Closed
j-clark opened this issue Jul 10, 2014 · 3 comments · Fixed by #109

Comments

@j-clark
Copy link

j-clark commented Jul 10, 2014

Getting the following error when running license_finder in a node project with ruby-1.9.3-p392 or ruby-2.1.2p95

/Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:42:in `map': undefined method `downcase' for ["type", "BSD"]:Array (NoMethodError)
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:42:in `matches_name?'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `block in whitelist_if_necessary'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `each'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `any?'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `whitelist_if_necessary'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:29:in `build_unrecognized'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:10:in `find_by_name'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:46:in `block in licenses_from_spec'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:45:in `map'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:45:in `licenses_from_spec'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:27:in `determine_license'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:21:in `license'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:28:in `save'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:12:in `block in save_all'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:11:in `map'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:11:in `save_all'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:7:in `block in sync_with_package_managers'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:38:in `block in modifying'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:126:in `_transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:100:in `block in transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/connecting.rb:229:in `block in synchronize'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/connection_pool/threaded.rb:104:in `hold'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/connecting.rb:229:in `synchronize'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:89:in `transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:38:in `modifying'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:6:in `sync_with_package_managers'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:17:in `block (2 levels) in sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:42:in `spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:16:in `block in sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:23:in `die_on_error'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:15:in `sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:220:in `rescan'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/bin/license_finder:5:in `<top (required)>'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/license_finder:19:in `load'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/license_finder:19:in `<main>'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/ruby_executable_hooks:15:in `eval'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/ruby_executable_hooks:15:in `<main>'

The package.json looks like this:

{
  "name": "junglebear",
  "version": "0.0.0",
  "repository": {
    "type": "git",
    "url": "AWESOME_CODE"
  },
  "dependencies": {},
  "devDependencies": {
    "buffer-crc32": "^0.2.1",
    "connect": "^3.0.1",
    "formidable": "^1.0.14",
    "grunt": "~0.4.1",
    "grunt-autoprefixer": "~0.2.0",
    "grunt-bower-install": "~0.5.0",
    "grunt-concurrent": "~0.3.0",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-contrib-compass": "~0.5.0",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-connect": "~0.5.0",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-cssmin": "~0.6.0",
    "grunt-contrib-htmlmin": "~0.1.3",
    "grunt-contrib-imagemin": "~0.2.0",
    "grunt-contrib-jshint": "~0.6.3",
    "grunt-contrib-uglify": "~0.2.0",
    "grunt-contrib-watch": "~0.5.2",
    "grunt-karma": "~0.7.1",
    "grunt-mocha": "~0.4.0",
    "grunt-phonegap": "~0.6.2",
    "grunt-rev": "~0.1.0",
    "grunt-svgmin": "~0.2.0",
    "grunt-usemin": "~0.1.10",
    "load-grunt-tasks": "~0.1.0",
    "send": "^0.1.1",
    "time-grunt": "~0.1.1"
  },
  "engines": {
    "node": ">=0.8.0"
  }
}
@flavorjones
Copy link
Contributor

Having trouble reproducing. What version of node, npm and license_finder are you running?

nodejs -v
npm -v
bundle show license_finder

For me:

$ nodejs -v
v0.10.29

$ npm -v
1.4.14

$ bundle show license_finder
/home/miked/.rvm/gems/ruby-2.0.0-p195/gems/license_finder-1.1.0

@j-clark
Copy link
Author

j-clark commented Jul 14, 2014

|ruby-2.1.2| sweet-host in ~/workspace/license-finder-debug
± jc+bk |master ✓| → node -v
v0.10.29    

|ruby-2.1.2| sweet-host in ~/workspace/license-finder-debug
± jc+bk |master ✓| → npm -v
1.4.16    

|ruby-2.1.2| sweet-host in ~/workspace/license-finder-debug
± jc+bk |master ✓| → bundle show license_finder
/Users/pivotal/.rvm/gems/ruby-2.1.2/gems/license_finder-1.1.0    

|ruby-2.1.2| sweet-host in ~/workspace/license-finder-debug
± jc+bk |master ✓| → ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

Also created a repo with the minimum amount of stuff we could come up with to reproduce it. https://github.com/j-clark/license_finder_debug

@flavorjones
Copy link
Contributor

Excellent, I'm able to reproduce with your sample repo. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants