Carriage return character missing (Style/EndOfLine) in Ruby on Rails

Viewed 6208

I'm writing an very simple Rails application. It was very simple but I always get an warning message "Carriage return character missing" even if in two examples blow... Can anyone tell me what is missing and what should I do to resolve this warning message? I'm using Ruby 2.3.3, Rails 5.1.2 and Rubocop 0.49.1... Rails router Two simple application

2 Answers

My fix was to:

  • cut the contents
  • delete the file
  • re-create the file
  • paste the contents back in

Rubocop was not happy with the way rails created the file.


In my case, I generated a project with rails new sample-project --api

After adding # frozen_string_literal: true to the top of config/seeds.rb, I got this error:

db/seeds.rb:1:1: C: Layout/EndOfLine: Carriage return character missing.
# frozen_string_literal: true ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Related