-
Notifications
You must be signed in to change notification settings - Fork 554
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
Comments
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? |
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. |
From here. |
See also #538 |
🎉 |
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
The text was updated successfully, but these errors were encountered: