ruby – Expected string default value for `–jbuilder`; got true (boolean) error in a new rails project

ruby – Expected string default value for `–jbuilder`; got true (boolean) error in a new rails project

I got this error yesterday. I also fixed by downgrading thor gem. gem thor, 0.19.1 When I wanted to generate again my app with a same name, or model in the command line it was hanging for a long period and nothing happend. I tried closing and reopening the terminal ( which others claimed that worked for them, so it could be another solution ) but it didnt work for me.

I fixed it by deleting /bin directory in my project and run: bundle install --binstubs which will regenerate bin directory again. Probably some paths from the previous project, were in the bin directory.

I hope it helps

Try setting Thor explicitly to the version you want.

In my Gemfile, I set the version to 0.19.1 and I also reject versions that I know are bad, in case a teammate edits the file, or to protect the app if a teammate runs bundle update.

Example:

rails new myapp -d postgresql --skip-bundle
cd myapp
echo gem thor, 0.19.1, !=0.19.2, !=0.19.3, !=0.19.4 >> Gemfile
bundle install --binstubs=binstubs --path vendor/bundle
bin/rails generate controller Welcome index

ruby – Expected string default value for `–jbuilder`; got true (boolean) error in a new rails project

Leave a Reply

Your email address will not be published. Required fields are marked *