1

Edited 12-21-16:

Upon using rails generate or destroy, errors of the type:

Expected string default value for '--jbuilder'; got true (boolean)
Expected string default value for '--helper'; got true (boolean)
Expected string default value for '--assets'; got true (boolean)

It also happens for rails g --help. The output may be informative:

C:\Sites\freshApp> rails g --help
Expected string default value for '--jbuilder'; got true (boolean)
Usage: rails generate GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

Please choose a generator below.

Expected string default value for '--helper'; got true (boolean)
Expected string default value for '--assets'; got true (boolean)
Rails:
  assets
  channel
  controller
  generator
  helper
  integration_test
  jbuilder
  job
  mailer
  migration
  model
  resource
  scaffold
  scaffold_controller
  task

Coffee:
  coffee:assets

Js:
  js:assets

TestUnit:
  test_unit:generator
  test_unit:plugin

I haven't noticed any problems with my applications yet. I've seen it on fresh Windows and Ubuntu environments. Will make effort to update later with my Ubuntu environment (which is similar).

Ruby: ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]

RubyDevKit: DevKit-mingw64-64-4.7.2-20130224-1432-sfx

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.0.1)
      actionpack (= 5.0.1)
      nio4r (~> 1.2)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.1)
      actionpack (= 5.0.1)
      actionview (= 5.0.1)
      activejob (= 5.0.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.1)
      actionview (= 5.0.1)
      activesupport (= 5.0.1)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.1)
      activesupport (= 5.0.1)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (5.0.1)
      activesupport (= 5.0.1)
      globalid (>= 0.3.6)
    activemodel (5.0.1)
      activesupport (= 5.0.1)
    activerecord (5.0.1)
      activemodel (= 5.0.1)
      activesupport (= 5.0.1)
      arel (~> 7.0)
    activesupport (5.0.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arel (7.1.4)
    builder (3.2.2)
    coffee-rails (4.2.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.2.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.3)
    debug_inspector (0.0.2)
    erubis (2.7.0)
    execjs (2.7.0)
    globalid (0.3.7)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    jbuilder (2.6.1)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.2.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    materialize-sass (0.97.8)
      sass (~> 3.3)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.1.0)
    minitest (5.10.1)
    multi_json (1.12.1)
    nio4r (1.2.1)
    nokogiri (1.6.8.1-x64-mingw32)
      mini_portile2 (~> 2.1.0)
    puma (3.6.2)
    rack (2.0.1)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.0.1)
      actioncable (= 5.0.1)
      actionmailer (= 5.0.1)
      actionpack (= 5.0.1)
      actionview (= 5.0.1)
      activejob (= 5.0.1)
      activemodel (= 5.0.1)
      activerecord (= 5.0.1)
      activesupport (= 5.0.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.0.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.1)
      activesupport (>= 4.2.0, < 6.0)
      nokogiri (~> 1.6.0)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (5.0.1)
      actionpack (= 5.0.1)
      activesupport (= 5.0.1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.0.0)
    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)
    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)
    sqlite3 (1.3.12-x64-mingw32)
    thor (0.19.4)
    thread_safe (0.3.5)
    tilt (2.0.5)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.0)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    tzinfo-data (1.2016.10)
      tzinfo (>= 1.0.0)
    uglifier (3.0.4)
      execjs (>= 0.3.0, < 3)
    web-console (3.4.0)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      debug_inspector
      railties (>= 5.0)
    websocket-driver (0.6.4)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)

PLATFORMS
  x64-mingw32

DEPENDENCIES
  byebug
  coffee-rails (~> 4.2)
  jbuilder (~> 2.5)
  jquery-rails
  materialize-sass
  puma (~> 3.0)
  rails (~> 5.0.0, >= 5.0.0.1)
  sass-rails (~> 5.0)
  sqlite3
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console

BUNDLED WITH
   1.13.6

Original Question: I'm getting

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

upon running "rails g scaffold Link" on a fresh install of rails using the dockerfile below. It's been a day now, and I've searched for the warnings, not finding any record of it on google. I don't recall having these problems in the past (though my experience with rails and docker is not immense).

FROM ruby:2.2.0
RUN apt-get update -qq && apt-get install -y build-essential
# for postgres
RUN apt-get install -y libpq-dev
# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev
# for capybara-webkit
RUN apt-get install -y libqt4-webkit libqt4-dev xvfb
# for a JS runtime
RUN apt-get install -y nodejs
RUN gem install rails -v 4.1.5
RUN gem install bundler
RUN rails new railsapp
RUN cd /railsapp/; rails g scaffold Link

I get similar errors no "rails g controller test"

weezilla
  • 158
  • 14
  • Tried running `bundle install` after `rails new [project]` and before generating the scaffold? – unmultimedio Dec 06 '16 at 04:53
  • Yes I had, with similar errors. Unfortunately I'll be unable to reproduce further as I have formatted the computer. **All I determined** is that it was an issue coming from my Windows 10 x64 pro command terminal that had about 4 years of wear and year. The issues were experienced in docker, remote putty sessions, and the railsinstaller cmd prompt--all of which were being broken by whatever my terminal issue was. I had checked my environment variables and didn't see anything interesting, but something must have been going on. – weezilla Dec 07 '16 at 20:46
  • I suspect it is devise gem. Busy now. Will try to verify and come back later. – weezilla Dec 14 '16 at 07:32
  • I'm in a similar situation. No `devise` or anything like that. – art-solopov Jan 06 '17 at 18:07
  • 1
    @art-solopov Since I posted this, a solution has been found in a different question (fished up by Wayne Conrad)! Cause: Thor gem. http://stackoverflow.com/questions/40986923/meaning-of-expected-string-default-value-for-on-ruby-on-rails?noredirect=1&lq=1 – weezilla Jan 06 '17 at 22:56
  • 1
    Thanks @weezilla, I found the solution as well and marked the question as duplicate. – art-solopov Jan 06 '17 at 23:24

0 Answers0