I received this strange error message that is stopping me from working on my application.
undefined method `start_with? 'for nil: NilClass
with line 5 highlighted in the file app / views / layouts / application.html.erb:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
The error seems to come out of nowhere. When I first got this, I tried to download CarrierWave. I went through ReadMe but it did not work, so I tried to return from the installation.
When I comment on this line, the application loads, but without formatting without rebooting. At first, I focused my search on CarrierWave, removed and reinstalled the gem, but was unsuccessful and did not find anything that would really point me in the right direction. I spent a few days here. Finally, I turned to a mentor who pulled my code from github and found no errors. The app worked great for him. I removed the previous, known working fix, and it worked for me as well. So, although I did not decide, I could continue to work on my application (the need for repeated work). Now the problem arose while working on my application. Not CarrierWave this time, just normal editing. Without warning, the application just stopped loading,but with the same start_with? error message in the file app / views / layouts / application.html.erb.
I spent a lot of time searching for answers and a permanent fix in Stackoverflow.
Solutions that seemed to work for others but DON'T CONTINUE for me: 1. Delete // = require_tree. from .js and 2. application. Download and install node.js
Some posts support the idea that the idea that the problem is local and will only appear in dev, not in prod. I am currently working in dev. While there was a lot of other information, I struggled with this for several days and feel that all possible solutions are pushing me further down the rabbit hole, which is completely alien to me. I am new ... about 3 months in my knowledge of Ruby. I am not even sure which code to add here because I cannot isolate the problem. I only know that formatting seems to be affected when I comment out line 5 (as above).
, , . , , , , , Ruby/Rails.
gem . , - .
ruby '2.2.0'
source 'https://rubygems.org'
group :production do
gem 'pg'
gem 'rails_12factor'
end
gem 'font-awesome-sass'
gem 'bootstrap-sass'
gem 'simple_form'
gem 'devise'
gem 'seed_dump'
gem 'rails', '4.2.0'
group :development do
gem 'sqlite3'
end
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
end
application.js
, , , User.
. , . , .