Home>
I'm having trouble getting an error when doing rails new.
Error messagebundler: 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)>'
Applicable source code
bundle exec rails new task
I found a person with a similar error, so I tried the solution he had done, but it was no good.
https://www.tutorialfor.com/go.php?id=184585
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
-
Answer # 1
Related articles
- ruby on rails 5 - precompiling assets failed cannot be resolved when deploying heroku
- bundler: failed to load command: rails (/ usr/local/bundle/bin/rails) on the web with docker-compose up
- ruby on rails - about bundler of dockerfile when deploying rails application to ec2
- ruby on rails - pg :: datatypemismatch error when doing heroku run rails db: migrate
- ruby on rails - things associated with a foreign key cannot be called in view
- ruby - rails tutorial chapter 2 (6th edition)
- ruby on rails - saved description in nested controller
- ruby on rails - cart function routing error cannot be resolved
- ruby on rails - rails s can't
- ruby on rails - how to transition from the top page
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- ruby on rails 6 - environment construction of ruby on rails
- ruby on rails - mvc rails
- ruby on rails 5 - actioncontroller :: invalidauthenticitytoken cannot be resolved
- ruby on rails - error in controller when transitioning with rails6 destory action
- ruby on rails - access fails after seed after deploying to heroku
- ruby on rails runtime error cannot be resolved
- ruby on rails - missing required keys: i'm having trouble resolving the [: id] error
- ruby on rails 5 - some items are not saved in db when posting from rails form
- bootstrap display in ruby on rails is broken
Related questions
- ruby - passing variables using render partial
- ruby - #i want to see a list of posts for that user on the user details page
- ruby - implementation of friendly forwarding
- ruby - i installed carrierwave with rails, but i can't see the image
- ruby - about rails controller new action
- ruby - rails page does not open
- [ruby] i'm having trouble with nomethoderror
- ruby - [search function] acquisition of products associated with users
- ruby - even if each statement is used, the contents of the db cannot be displayed in order and an error occurs
- ruby - if i include the'omniauth-facebook'gem, do i need to install the'omniauth' gem as well?
I was drafted here,
This seems to be a bug caused by ruby 2.5.0 ERB compatibility.
There are two ways to solve this.
Increase ruby version
Fix the location where syntax error occurs.
For1, I think that you can upgrade ruby to your environment.
Please try to modify2 as follows.
File to be modified
Project directory name/vendor/bundle/ruby / 2.5.0/gems/railties-6.0.1/lib/rails/generators/rails/app/templates/config/environments/test.rb