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

"Expected string default value for '--serializer'; got true (boolean)" Rails 5.0.2, thor 0.19.4 #554

Closed
reneweteling opened this issue Mar 14, 2017 · 5 comments

Comments

@reneweteling
Copy link

Hi So im just upgrading to rails 5.0.2 and with thor 0.19.4 i get the

Expected string default value for '--serializer'; got true (boolean)

message, downgrading to 0.19.1 fixes this issue for me (this was the version i was using before thats why i havent tried 2 or 3)

Thanks!

Here is my gemfile.lock for more info

GIT
  remote: git://github.com/activeadmin/activeadmin.git
  revision: ecc817f7e200f1f9459ad019adbbc95ca1245977
  specs:
    activeadmin (1.0.0.pre5)
      arbre (~> 1.0, >= 1.0.2)
      bourbon
      coffee-rails
      formtastic (~> 3.1)
      formtastic_i18n
      inherited_resources (~> 1.7)
      jquery-rails
      jquery-ui-rails
      kaminari (>= 0.15, < 2.0)
      railties (>= 4.0, < 5.1)
      ransack (~> 1.3)
      sass-rails
      sprockets (< 4.1)

GIT
  remote: git://github.com/reneweteling/axlsx.git
  revision: 776aaf53cb5c19c854c27f5daedd40431ad5b2ba
  specs:
    axlsx (2.1.0.pre)
      htmlentities (~> 4.3.4)
      mimemagic (~> 0.3)
      nokogiri (>= 1.6.6)
      rubyzip (~> 1.1.7)

GEM
  remote: https://rubygems.org/
  remote: https://rails-assets.org/
  specs:
    actioncable (5.0.2)
      actionpack (= 5.0.2)
      nio4r (>= 1.2, < 3.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.2)
      actionpack (= 5.0.2)
      actionview (= 5.0.2)
      activejob (= 5.0.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.2)
      actionview (= 5.0.2)
      activesupport (= 5.0.2)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.2)
      activesupport (= 5.0.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_admin-subnav (1.0.0)
      activeadmin
    active_model_serializers (0.9.5)
      activemodel (>= 3.2)
    activeadmin-sortable (0.0.3)
      activeadmin (>= 0.4)
    activeadmin_addons (0.10.1)
      railties
      select2-rails (~> 3.5.9)
      xdan-datetimepicker-rails (~> 2.5.1)
    activejob (5.0.2)
      activesupport (= 5.0.2)
      globalid (>= 0.3.6)
    activemodel (5.0.2)
      activesupport (= 5.0.2)
    activerecord (5.0.2)
      activemodel (= 5.0.2)
      activesupport (= 5.0.2)
      arel (~> 7.0)
    activerecord-session_store (1.0.0)
      actionpack (>= 4.0, < 5.1)
      activerecord (>= 4.0, < 5.1)
      multi_json (~> 1.11, >= 1.11.2)
      rack (>= 1.5.2, < 3)
      railties (>= 4.0, < 5.1)
    activesupport (5.0.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    acts_as_list (0.9.3)
      activerecord (>= 3.0)
    addressable (2.5.0)
      public_suffix (~> 2.0, >= 2.0.2)
    arbre (1.1.1)
      activesupport (>= 3.0.0)
    arel (7.1.4)
    autoprefixer-rails (6.7.7)
      execjs
    aws-sdk (2.8.7)
      aws-sdk-resources (= 2.8.7)
    aws-sdk-core (2.8.7)
      aws-sigv4 (~> 1.0)
      jmespath (~> 1.0)
    aws-sdk-resources (2.8.7)
      aws-sdk-core (= 2.8.7)
    aws-sigv4 (1.0.0)
    axlsx_rails (0.5.0)
      actionpack (>= 3.1)
      axlsx (>= 2.0.1)
    bcrypt (3.1.11)
    bourbon (4.3.3)
      sass (~> 3.4)
      thor (~> 0.19)
    browser (2.3.0)
    builder (3.2.3)
    bullet (5.5.1)
      activesupport (>= 3.0.0)
      uniform_notifier (~> 1.10.0)
    cancancan (1.16.0)
    capybara (2.12.1)
      addressable
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    carrierwave (0.11.2)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
      mimemagic (>= 0.3.0)
    carrierwave-aws (1.1.0)
      aws-sdk (~> 2.0)
      carrierwave (>= 0.7, < 2.0)
    carrierwave_backgrounder (0.4.2)
      carrierwave (~> 0.5)
    childprocess (0.6.2)
      ffi (~> 1.0, >= 1.0.11)
    coderay (1.1.1)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    combine_pdf (0.2.35)
      ruby-rc4 (>= 0.1.5)
    concurrent-ruby (1.0.5)
    daemons (1.2.4)
    dalli (2.7.6)
    database_cleaner (1.5.3)
    delayed_cron_job (0.7.1)
      delayed_job (>= 4.1)
    delayed_job (4.1.2)
      activesupport (>= 3.0, < 5.1)
    delayed_job_active_record (4.1.1)
      activerecord (>= 3.0, < 5.1)
      delayed_job (>= 3.0, < 5)
    devise (4.2.0)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    devise-token_authenticatable (0.5.2)
      devise (>= 4.0.0, < 4.3.0)
    diff-lcs (1.3)
    elfproef (0.2.0)
      activemodel
    erubis (2.7.0)
    execjs (2.7.0)
    factory_girl (4.8.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.8.0)
      factory_girl (~> 4.8.0)
      railties (>= 3.0.0)
    faker (1.7.3)
      i18n (~> 0.5)
    ffi (1.9.18)
    font-awesome-sass (4.6.2)
      sass (>= 3.2)
    formtastic (3.1.5)
      actionpack (>= 3.2.13)
    formtastic_i18n (0.6.0)
    get_process_mem (0.2.1)
    globalid (0.3.7)
      activesupport (>= 4.1.0)
    has_scope (0.7.0)
      actionpack (>= 4.1, < 5.1)
      activesupport (>= 4.1, < 5.1)
    htmlentities (4.3.4)
    i18n (0.8.1)
    inherited_resources (1.7.0)
      actionpack (>= 3.2, < 5.1)
      has_scope (~> 0.6)
      railties (>= 3.2, < 5.1)
      responders
    jmespath (1.3.1)
    jquery-fileupload-rails (0.4.7)
      actionpack (>= 3.1)
      railties (>= 3.1)
      sass (>= 3.2)
    jquery-rails (4.2.2)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (6.0.1)
      railties (>= 3.2.16)
    json (2.0.3)
    just-datetime-picker (0.0.7)
      activeadmin (>= 0.4.4)
      formtastic (>= 2.0.0)
    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)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      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)
    mimemagic (0.3.2)
    mini_magick (4.6.1)
    mini_portile2 (2.1.0)
    minitest (5.10.1)
    multi_json (1.12.1)
    nio4r (2.0.0)
    nokogiri (1.7.0.1)
      mini_portile2 (~> 2.1.0)
    orm_adapter (0.5.0)
    paper_trail (6.0.2)
      activerecord (>= 4.0, < 5.2)
      request_store (~> 1.1)
    pdfkit (0.8.2)
    pg (0.20.0)
    polyamorous (1.3.1)
      activerecord (>= 3.0)
    pry (0.10.4)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    public_suffix (2.0.5)
    puma (3.8.1)
    puma_worker_killer (0.0.7)
      get_process_mem (~> 0.2)
      puma (>= 2.7, < 4)
    rack (2.0.1)
    rack-cors (0.4.1)
    rack-test (0.6.3)
      rack (>= 1.0)
    rack-timeout (0.4.2)
    rails (5.0.2)
      actioncable (= 5.0.2)
      actionmailer (= 5.0.2)
      actionpack (= 5.0.2)
      actionview (= 5.0.2)
      activejob (= 5.0.2)
      activemodel (= 5.0.2)
      activerecord (= 5.0.2)
      activesupport (= 5.0.2)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.0.2)
      sprockets-rails (>= 2.0.0)
    rails-assets-bootstrap-sass (3.3.7)
      rails-assets-jquery (>= 1.9.1, < 4)
    rails-assets-jquery (2.2.4)
    rails-assets-jquery-autogrow-textarea (1.1.0)
      rails-assets-jquery (>= 2.0.0, < 3)
    rails-assets-jquery-ui (1.12.1)
      rails-assets-jquery (>= 1.6)
    rails-assets-jquery-ui-bootstrap (0.2.5)
      rails-assets-jquery-ui (>= 1.9.0)
    rails-assets-signature-pad (2.5.2)
    rails-dom-testing (2.0.2)
      activesupport (>= 4.2.0, < 6.0)
      nokogiri (~> 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (5.0.2)
      actionpack (= 5.0.2)
      activesupport (= 5.0.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.0.0)
    ransack (1.8.2)
      actionpack (>= 3.0)
      activerecord (>= 3.0)
      activesupport (>= 3.0)
      i18n
      polyamorous (~> 1.3)
    request_store (1.3.2)
    responders (2.3.0)
      railties (>= 4.2.0, < 5.1)
    roo (2.1.1)
      nokogiri (~> 1)
      rubyzip (~> 1.1, < 2.0.0)
    rspec-core (3.5.4)
      rspec-support (~> 3.5.0)
    rspec-expectations (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-mocks (3.5.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.5.0)
    rspec-rails (3.5.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.5.0)
      rspec-expectations (~> 3.5.0)
      rspec-mocks (~> 3.5.0)
      rspec-support (~> 3.5.0)
    rspec-support (3.5.0)
    rspec_junit_formatter (0.2.2)
      builder (< 4)
      rspec-core (>= 2, < 4, != 2.12.0)
    ruby-rc4 (0.1.5)
    rubyzip (1.1.7)
    s3_direct_upload (0.1.7)
      coffee-rails (>= 3.1)
      jquery-fileupload-rails (~> 0.4.1)
      rails (>= 3.1)
      sass-rails (>= 3.1)
    sass (3.4.23)
    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)
    sassc (1.11.2)
      bundler
      ffi (~> 1.9.6)
      sass (>= 3.3.0)
    sassc-rails (1.3.0)
      railties (>= 4.0.0)
      sass
      sassc (~> 1.9)
      sprockets (> 2.11)
      sprockets-rails
      tilt
    scout_apm (3.0.0.pre9)
    select2-rails (3.5.10)
      thor (~> 0.14)
    selenium-webdriver (3.3.0)
      childprocess (~> 0.5)
      rubyzip (~> 1.0)
      websocket (~> 1.0)
    simple_form (3.2.1)
      actionpack (> 4, < 5.1)
      activemodel (> 4, < 5.1)
    slim (3.0.7)
      temple (~> 0.7.6)
      tilt (>= 1.3.3, < 2.1)
    slim-rails (3.1.2)
      actionpack (>= 3.1)
      railties (>= 3.1)
      slim (~> 3.0)
    slop (3.6.0)
    spring (2.0.1)
      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)
    temple (0.7.7)
    thor (0.19.1)
    thread_safe (0.3.6)
    tilt (2.0.6)
    timecop (0.8.1)
    timeliness (0.3.8)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.1.7)
      execjs (>= 0.3.0, < 3)
    uniform_notifier (1.10.0)
    validates_timeliness (4.0.2)
      timeliness (~> 0.3.7)
    warden (1.2.7)
      rack (>= 1.0)
    websocket (1.2.4)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)
    will_paginate (3.0.12)
    wkhtmltopdf-heroku (2.12.3.0)
    xdan-datetimepicker-rails (2.5.4)
      jquery-rails
      rails (>= 3.2.16)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  active_admin-subnav
  active_model_serializers (= 0.9.5)
  activeadmin!
  activeadmin-sortable
  activeadmin_addons
  activerecord-session_store
  acts_as_list
  autoprefixer-rails
  axlsx!
  axlsx_rails
  browser
  bullet
  cancancan (~> 1.10)
  capybara
  carrierwave
  carrierwave-aws
  carrierwave_backgrounder
  coffee-rails (~> 4.1.0)
  combine_pdf
  daemons
  dalli
  database_cleaner
  delayed_cron_job
  delayed_job_active_record
  devise
  devise-token_authenticatable
  elfproef
  factory_girl_rails
  faker
  font-awesome-sass (~> 4.6.2)
  jquery-rails
  just-datetime-picker
  mini_magick
  paper_trail
  pdfkit
  pg
  pry
  puma
  puma_worker_killer
  rack-cors
  rack-timeout
  rails (~> 5.0)
  rails-assets-bootstrap-sass!
  rails-assets-jquery-autogrow-textarea!
  rails-assets-jquery-ui-bootstrap!
  rails-assets-signature-pad!
  rails_12factor
  roo (~> 2.1.0)
  rspec-rails (~> 3.0)
  rspec_junit_formatter (= 0.2.2)
  s3_direct_upload
  sass-rails
  sassc-rails
  scout_apm (~> 3.0.x)
  select2-rails
  selenium-webdriver
  simple_form (~> 3.2.1)
  slim-rails
  spring
  thor (= 0.19.1)
  timecop
  uglifier (>= 1.3.0)
  validates_timeliness (~> 4.0)
  will_paginate (~> 3.0.6)
  wkhtmltopdf-heroku

RUBY VERSION
   ruby 2.3.1p112

BUNDLED WITH
   1.14.6

@piotrmurach
Copy link

The error may well be raised by Thor but are you able to check whether this can be fixed in Rails itself? What command are you running to get this? It is obvious that the type specified for the option is expected to be string but I would be curious to find this particular option definition in Rails itself?

@ananova
Copy link

ananova commented Mar 27, 2017

Just noting this is not unique to Rails 5, but happens with rails 4 also.

In /lib/thor/parser/option.rb:

    def validate_default_type!
      default_type = case @default
      when nil
        return
      when TrueClass, FalseClass
        required? ? :string : :boolean
      when Numeric
        :numeric
      when Symbol
        :string
      when Hash, Array, String
        @default.class.name.downcase.to_sym
      end

      # TODO: This should raise an ArgumentError in a future version of Thor
      warn "Expected #{@type} default value for '#{switch_name}'; got #{@default.inspect} (#{default_type})" unless default_type == @type
    end

We receive these warnings any time rails loads; so rspec, rake, rails commands.

@ananova
Copy link

ananova commented Mar 27, 2017

From here.

@jopotts
Copy link

jopotts commented Apr 24, 2017

See also #538

@ananova
Copy link

ananova commented Sep 18, 2018

🎉

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

No branches or pull requests

4 participants