前提・実現したいこと
rails newをする際にエラーが出て困っています。
発生している問題・エラーメッセージ
bundler: failed to load command: rails (/Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/bin/rails) SyntaxError: /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt:10: syntax error, unexpected ')', expecting end-of-input ); if spring_install? ^ /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/erb.rb:885:in `eval' /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/erb.rb:885:in `result' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/file_manipulation.rb:131:in `block in template' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:53:in `render' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:63:in `open' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:63:in `block in invoke!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/empty_directory.rb:117:in `invoke_with_conflict_check' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:60:in `invoke!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions.rb:94:in `action' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/create_file.rb:25:in `create_file' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/file_manipulation.rb:122:in `template' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/directory.rb:92:in `block in execute!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/directory.rb:80:in `each' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/directory.rb:80:in `execute!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/directory.rb:66:in `invoke!' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions.rb:94:in `action' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions/directory.rb:52:in `directory' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/app_generator.rb:19:in `directory' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/app_generator.rb:115:in `block in config' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions.rb:188:in `block in inside' /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/fileutils.rb:122:in `chdir' /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/fileutils.rb:122:in `cd' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/actions.rb:188:in `inside' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/app_generator.rb:19:in `inside' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/app_generator.rb:106:in `config' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/app_base.rb:156:in `build' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/app_generator.rb:319:in `create_config_files' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `block in invoke_all' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `each' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `map' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:133:in `invoke_all' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/group.rb:232:in `dispatch' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/commands/application/application_command.rb:26:in `perform' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/command/base.rb:65:in `perform' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/command.rb:46:in `invoke' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/lib/rails/cli.rb:18:in `<top (required)>' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/exe/rails:10:in `require' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/gems/railties-6.0.1/exe/rails:10:in `<top (required)>' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/bin/rails:23:in `load' /Users/username/Desktop/vue_rails/vendor/bundle/ruby/2.5.0/bin/rails:23:in `<top (required)>'
該当のソースコード
bundle exec rails new task
試したこと
同じようなエラーが出ている人を見つけたのでその人が行なった解決策を試してみましたがダメでした。
https://teratail.com/questions/184585
補足情報(FW/ツールのバージョンなど)
ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin18]
bundle -v
Bundler version 2.0.2
bundle exec rails -v
Rails 6.0.1
rubyのバージョンと拝見したエラーの内容から
原因に当たりそうな所を回答させていただきましたが、
エラーが解消されない場合は回答へコメントいただければ追加で調べてみたいと思います!
回答1件
あなたの回答
tips
プレビュー