[Rails error] unexpected tIDENTIFIER

Introduction

This is a common error.

I'll take a note: snowman2:

problem

I got an error while writing a test for Rspec.


SyntaxError:
  /Users/namae/projects/picapp/spec/models/user_spec.rb:8: syntax error, unexpected tIDENTIFIER, expecting end
  ...'New user registration' do
  ...                          ^~~~~
  /Users/namae/projects/picapp/spec/models/user_spec.rb:20: syntax error, unexpected end, expecting end-of-input
    end
    ^~~

Result of investigation

It's a syntax error, as it says "Syntax Error" at the beginning. There are missing commas, missing spaces, and full-width spaces ... Then an error will occur.

Summary

It shouldn't be the case, but you have to be careful.

Recommended Posts

[Rails error] unexpected tIDENTIFIER
[Rails] Unexpected validation error in devise
[Rails] syntax error, unexpected tSTRING_END, expecting'''
[Note] Rails error list
Catch Rails Routing Error
Mac Rails Install Error
rails heroku error log
rails error resolution summary
[Rails] How to solve "Uglifier :: Error: Unexpected character'`'"
Error in rails db: migrate
[Rails] Rails version upgrade error memorandum
Error when using rails capybara
[rails] error during devise installation
[Rails] What was the error message?
[Rails] Japanese localization of error messages
[Rails] Display form error messages asynchronously
Japanese localization of error messages (rails)
[Rails] About Uglifier :: Error: Unexpected token: at the time of deployment
[Rails] AWS deployment error encounter summary
[Rails] How to display error messages individually
Testing for Error Messages: Rails Tutorial Notes-Chapter 7
[Ruby / Rails] Mechanism for retrying Thread Error
[rails s error] md5.bundle and mysql installation error
rails test fails with database reference error
Rails console Incorrect string value error handling
Let's make an error screen with Rails
[Rails / Heroku] Error resolution procedure after push