Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

TypeError: no implicit conversion of Hash into String #5881

Closed
s0rin opened this issue Jul 20, 2017 · 1 comment · Fixed by #5885
Closed

TypeError: no implicit conversion of Hash into String #5881

s0rin opened this issue Jul 20, 2017 · 1 comment · Fixed by #5885
Assignees
Milestone

Comments

@s0rin
Copy link

s0rin commented Jul 20, 2017

--- ERROR REPORT TEMPLATE -------------------------------------------------------

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

  • What did you do?

I ran the command /var/www/.rbenv/versions/2.3.0/bin/bundle install

  • What did you expect to happen?

    I expected Bundler to complete the installation without errors

  • What happened instead?

    Instead, Bundler failed with TypeError: no implicit conversion of Hash into String error

  • Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?

    I tried...

  • Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?

    ...

Backtrace

TypeError: no implicit conversion of Hash into String
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/install.rb:75:in `expand_path'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/install.rb:75:in `run'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:186:in `block in install'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/settings.rb:92:in `temporary'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:185:in `install'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
  /var/www/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
  /var/www/.rbenv/versions/2.3.0/bin/bundle:23:in `load'
  /var/www/.rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
  /var/www/.rbenv/versions/2.3.0/bin/ruby_executable_hooks:15:in `eval'
  /var/www/.rbenv/versions/2.3.0/bin/ruby_executable_hooks:15:in `<main>'

Environment

Bundler   1.15.2
Rubygems  2.6.12
Ruby      2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
GEM_HOME  /var/www/konsys/{}/ruby/2.3.0
GEM_PATH
Git       1.7.9.5
Platform  x86_64-linux
OpenSSL   OpenSSL 1.0.1 14 Mar 2012

Bundler settings

build.nokogiri
  Set for the current user (/tmp/bundler/home/tuser/.bundle/config): "--use-system-libraries"
frozen
  Set for your local app (/var/www/konsys/.bundle/config): true
path
  Set for your local app (/var/www/konsys/.bundle/config): {}
disable_shared_gems
  Set for your local app (/var/www/konsys/.bundle/config): true
bin
  Set for your local app (/var/www/konsys/.bundle/config): "bin"

Gemfile

Gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.1.2'
gem 'activesupport'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2.1'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

#gem 'protected_attributes'    # no longer supported in Rails 5
gem 'ancestry'
gem 'paranoia', "~> 2.2"
gem "cocoon"

# Gems for Devise & CanCan
gem 'devise'
gem 'cancancan'
gem 'net-ldap'

gem 'jquery-turbolinks'
gem 'jquery-ui-rails'
gem 'jquery-hotkeys-rails'
#gem 'jquery-validation-rails'
#gem "jstree-rails-4"

gem 'bootstrap-sass'
#gem 'bootstrap_form'
#gem 'bootstrap-typeahead-rails'
gem 'font-awesome-sass'
gem 'rails-i18n'

gem 'sparql-client'
gem 'sru'
gem 'sunspot_rails'
gem 'rsolr'
gem 'progress_bar'
gem 'kaminari'
#gem 'handlebars_assets'

#gem 'momentjs-rails', '>= 2.9.0'
#gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
gem 'bootstrap-datepicker-rails'
gem 'bootstrap-timepicker-rails-addon'
#gem 'validates_timeliness'
#gem 'date_validator'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.1.2)
      actionpack (= 5.1.2)
      nio4r (~> 2.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.1.2)
      actionpack (= 5.1.2)
      actionview (= 5.1.2)
      activejob (= 5.1.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.1.2)
      actionview (= 5.1.2)
      activesupport (= 5.1.2)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.1.2)
      activesupport (= 5.1.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (5.1.2)
      activesupport (= 5.1.2)
      globalid (>= 0.3.6)
    activemodel (5.1.2)
      activesupport (= 5.1.2)
    activerecord (5.1.2)
      activemodel (= 5.1.2)
      activesupport (= 5.1.2)
      arel (~> 8.0)
    activesupport (5.1.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    ancestry (3.0.1)
      activerecord (>= 3.2.0)
    arel (8.0.0)
    autoprefixer-rails (7.1.2.2)
      execjs
    bcrypt (3.1.11)
    bindex (0.5.0)
    bootstrap-datepicker-rails (1.6.4.1)
      railties (>= 3.0)
    bootstrap-sass (3.3.7)
      autoprefixer-rails (>= 5.2.1)
      sass (>= 3.3.4)
    bootstrap-timepicker-rails-addon (0.5.2)
      railties (>= 3.1, < 6.0)
    builder (3.2.3)
    byebug (9.0.6)
    cancancan (2.0.0)
    cocoon (1.2.10)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.5)
    devise (4.3.0)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.2)
      responders
      warden (~> 1.2.3)
    erubi (1.6.1)
    execjs (2.7.0)
    faraday (0.12.1)
      multipart-post (>= 1.2, < 3)
    ffi (1.9.18)
    font-awesome-sass (4.7.0)
      sass (>= 3.2)
    globalid (0.4.0)
      activesupport (>= 4.2.0)
    hamster (3.0.0)
      concurrent-ruby (~> 1.0)
    highline (1.7.8)
    i18n (0.8.6)
    jbuilder (2.7.0)
      activesupport (>= 4.2.0)
      multi_json (>= 1.2)
    jquery-hotkeys-rails (0.7.9.1)
      railties (>= 3.1)
    jquery-rails (4.3.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-turbolinks (2.1.0)
      railties (>= 3.1.0)
      turbolinks
    jquery-ui-rails (6.0.1)
      railties (>= 3.2.16)
    json (1.8.6)
    kaminari (1.0.1)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.0.1)
      kaminari-activerecord (= 1.0.1)
      kaminari-core (= 1.0.1)
    kaminari-actionview (1.0.1)
      actionview
      kaminari-core (= 1.0.1)
    kaminari-activerecord (1.0.1)
      activerecord
      kaminari-core (= 1.0.1)
    kaminari-core (1.0.1)
    libxml-ruby (3.0.0)
    link_header (0.0.8)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.6)
      mime-types (>= 1.16, < 4)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.2.0)
    minitest (5.10.2)
    multi_json (1.12.1)
    multipart-post (2.0.0)
    net-http-persistent (2.9.4)
    net-ldap (0.16.0)
    nio4r (2.1.0)
    nokogiri (1.8.0)
      mini_portile2 (~> 2.2.0)
    options (2.3.2)
    orm_adapter (0.5.0)
    paranoia (2.3.1)
      activerecord (>= 4.0, < 5.2)
    pg (0.21.0)
    pr_geohash (1.0.0)
    progress_bar (1.1.0)
      highline (~> 1.6)
      options (~> 2.3.0)
    rack (2.0.3)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.1.2)
      actioncable (= 5.1.2)
      actionmailer (= 5.1.2)
      actionpack (= 5.1.2)
      actionview (= 5.1.2)
      activejob (= 5.1.2)
      activemodel (= 5.1.2)
      activerecord (= 5.1.2)
      activesupport (= 5.1.2)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.1.2)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails-i18n (5.0.4)
      i18n (~> 0.7)
      railties (~> 5.0)
    railties (5.1.2)
      actionpack (= 5.1.2)
      activesupport (= 5.1.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.0.0)
    rb-fsevent (0.10.2)
    rb-inotify (0.9.10)
      ffi (>= 0.5.0, < 2)
    rdf (2.2.6)
      hamster (~> 3.0)
      link_header (~> 0.0, >= 0.0.8)
    rdoc (4.3.0)
    responders (2.4.0)
      actionpack (>= 4.2.0, < 5.3)
      railties (>= 4.2.0, < 5.3)
    rsolr (2.0.2)
      builder (>= 2.1.2)
      faraday
    sass (3.5.1)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.2)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    sparql-client (2.1.0)
      net-http-persistent (~> 2.9)
      rdf (~> 2.0)
    spring (2.0.2)
      activesupport (>= 4.2)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sru (0.0.9)
      libxml-ruby
    sunspot (2.2.7)
      pr_geohash (~> 1.0)
      rsolr (>= 1.1.1, < 3)
    sunspot_rails (2.2.7)
      nokogiri
      rails (>= 3)
      sunspot (= 2.2.7)
    thor (0.19.4)
    thread_safe (0.3.6)
    tilt (2.0.7)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.3)
    tzinfo (1.2.3)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    warden (1.2.7)
      rack (>= 1.0)
    web-console (3.5.1)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)

PLATFORMS
  ruby

DEPENDENCIES
  activesupport
  ancestry
  bootstrap-datepicker-rails
  bootstrap-sass
  bootstrap-timepicker-rails-addon
  byebug
  cancancan
  cocoon
  coffee-rails (~> 4.2.1)
  devise
  font-awesome-sass
  jbuilder
  jquery-hotkeys-rails
  jquery-rails
  jquery-turbolinks
  jquery-ui-rails
  kaminari
  net-ldap
  paranoia (~> 2.2)
  pg
  progress_bar
  rails (= 5.1.2)
  rails-i18n
  rsolr
  sass-rails
  sdoc (~> 0.4.0)
  sparql-client
  spring
  sru
  sunspot_rails
  turbolinks
  uglifier
  web-console

BUNDLED WITH
   1.14.6

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

@segiddins
Copy link
Member

Thank, this is a bug with our YAML parser that treats "" as a hash. I think I've fixed it already, and if not I'll get a fix up soon. Thanks!

@segiddins segiddins added this to the 1.15.3 milestone Jul 20, 2017
@segiddins segiddins self-assigned this Jul 20, 2017
bundlerbot added a commit that referenced this issue Jul 20, 2017
[YAMLSerializer] Handle empty strings properly

### What was the end-user problem that led to this PR?

The problem was that empty strings in YAML were being read in as empty hashes.

Closes #5881.

### What was your diagnosis of the problem?

My diagnosis was we needed to fix the YAML Serializer to understand `""` as an empty string.

### What is your fix for the problem, implemented in this PR?

My fix ensures that a hash isn't created when the parser encounters `""`.
segiddins pushed a commit that referenced this issue Jul 21, 2017
[YAMLSerializer] Handle empty strings properly

### What was the end-user problem that led to this PR?

The problem was that empty strings in YAML were being read in as empty hashes.

Closes #5881.

### What was your diagnosis of the problem?

My diagnosis was we needed to fix the YAML Serializer to understand `""` as an empty string.

### What is your fix for the problem, implemented in this PR?

My fix ensures that a hash isn't created when the parser encounters `""`.

(cherry picked from commit d273f21)
hsbt pushed a commit to rubygems/bundler-graph that referenced this issue Oct 19, 2021
[YAMLSerializer] Handle empty strings properly

### What was the end-user problem that led to this PR?

The problem was that empty strings in YAML were being read in as empty hashes.

Closes rubygems/bundler#5881.

### What was your diagnosis of the problem?

My diagnosis was we needed to fix the YAML Serializer to understand `""` as an empty string.

### What is your fix for the problem, implemented in this PR?

My fix ensures that a hash isn't created when the parser encounters `""`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants