Repeating Error: undefined method `start_with?' for nil:NilClass

actionview::template::error undefined method `start_with?'
undefined method `start_with?' for nil:nilclass expo
sprockets 4
can t resolve image into url: undefined method to_model

I've gotten this weird error message that keeps me from working on my application.

undefined method `start_with?' for nil:NilClass

with line 5 highlighted in my app/views/layouts/application.html.erb file:

<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>

The error seems to come out of nowhere. The first time I got it I had attempted to load CarrierWave. I got through ReadMe but it didn't work so I tried to back out of the installation.

When I comment out this line the app loads but with no bootstrap formatting at all. I initially focused my search with CarrierWave, deleted and re-installed the gem, but was unsuccessful and found nothing really pointing me in the right direction. I spent days on this. Finally, I reached out to a mentor who pulled my code down from github and found no errors. The app worked fine for him. I pulled down a previous, known working commit, and it worked for me as well. So, although not solved I could continue working on my app (having to re-do some work). Now, the problem has reappeared while working on my app. Not CarrierWave this time, just normal editing. Without warning the application just stopped loading but with the same start_with? error message on my app/views/layouts/application.html.erb file.

I've spent a considerable amount of time searching for answers and a permanent fix on Stackoverflow.

Solutions that seemed to work for others, but HAVE NOT worked for me are: 1. Remove //= require_tree . from application.js, and 2. Downloading and installing node.js

Some posts support the thought that the idea that the issue is local and would only show up in dev, not prod. I'm only working in dev at the moment. While there's a lot of other info, I've struggled with this for days now and feel that every possible solution gets me further down a rabbit hole that is completely foreign to me. I am a newbie...about 3 months into my knowledge on Ruby. I'm really not even sure what code to add here because I can't seem to isolate the issue. I only know that formatting seems to be affected when I comment out line 5 (as above).

Trust me when I say I've searched quite a bit. I'm very hard headed, but optimistic I can find an answer if given the time but I'm stumped here and just want to move on with learning to create with Ruby/Rails.

My gem file is below. Perhaps I'm missing something very obvious.

ruby '2.2.0'

source ''

group :production do
  gem 'pg'
  gem 'rails_12factor'

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'
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'


//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require bootstrap-sprockets

The only other info I can provide is that I've scaffolded my resources and used devise to create my User model.

Thanks. I'm in your debt if you can help me solve this. I am new, but I want to learn.

I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-sprockets". Commenting this out solved it for me.

Repeating Error: undefined method `start_with?' for nil - php, I am having this error undefined method `start_with?' - I don't understand images/bg-image-2.jpg") 50% 0px no-repeat; }. Problem existed  Was getting NoMethodError: undefined method `start_with?' for #<Proc:0x00000002a6dbd0>. Fix from here lautis/uglifier#137 vict0rsch mentioned this issue Aug 2, 2019

Thanks this helped me work out a bit more of whats going on. Seriously unhelpful error message.

Commenting out $icon-font-path in _variables.scss worked for me. If you have a look you will see that there is a [converter] comment that says:

If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path. This is because some asset helpers, such as Sprockets, do not work with file-relative paths.

If you are not using the fonts just comment it out. If you need to use them set $bootstrap-sass-asset-helper to true and set the path as needed. That also worked for me.

4.0 error undefined method start_with? · Issue #632 · rails/sprockets , Summary: UI: Adding new Catalog Bundle from Services shows "undefined shows "Unexpected error encountered" with "undefined method `start_with?' for  @unixmonkey Yeah, I sympathise with the issues as described and I'm afraid I'm not familiar enough with wicked_pdf to be able to suggest solutions directly. I'm just in the middle of a process of figuring out where our application is in terms of Rails 5 readiness.

It seems that the order is important here, the following order - if bootstrap-sprockets is defined before bootstrap - causes this error

@import "bootstrap-sprockets";
@import "bootstrap";

while this order seems to work

@import "bootstrap";
@import "bootstrap-sprockets";

ActionView::Template::Error (undefined method `start_with?' for nil , code-project with ID: 41 export error - Error importing repository into [​FILTERED] - undefined method `start_with?' for nil:NilClass [ActiveJob]  Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Whether it's connected to the issue or not, uncommenting "bootstrap-sprockets", and changing the $icon-font-path and $icon-font-name to @icon-font-path and @icon-font-name (app/stylesheets/_variables.scss under Iconography) appeared to solve this and an additional issue I was having with glyphicons not displaying. Not sure exactly how but all appears to be working. The syntax errors in my controllers were likely coincidental. Although it wasn't the exact solution, @TheRealSeanReid pointed me in a direction that appears to have worked. Credit is deserved. Thanks @TheRealSeanReid.

undefined method `start_with?' for nil:NilClass , Basically, we group two errors if the second one is just a repeat of the first. and getting a NoMethodError: undefined method street for  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

I had this problem as well, but what was causing it was an incorrect value passed into an image-url() helper in a .scss file. We had background-image: image-url('./image.png'); instead of background-image: image-url('image.png');

"undefined method `start_with?' for nil:NilClass" (#12305 , Because of aliasing issues, users of strings should be aware of the methods Failure in generation of a proper salt string tends not to yield any errors; typos in Sets the replacement string by the given object for undefined character. This process repeats until there is no carry, adding an additional character if necessary. Original issue by @VictorJava - Imported from fastlane/screengrab#84 Hi guys, I trying start screengrab in Ubuntu with Android project. My way: call screengrab in terminal -&gt; put package -&gt; s

Top 10 errors from 1000+ Ruby on Rails projects (and how to avoid , Tagged capybara, cucumber, minitest Languages ruby. When Capybara/​Cucumber tests fail: undefined method `+' for nil:NilClass (NoMethodError) . If you do not need the Repeating Section's data to be transformed and saved into other formats for other purposes, here is my sharing on how show the Repeating Section as table in List View using the native Sharepoint feature - CSR (i.e. as such this solution will work only in Sharepoint 2013 on-prem or Office 365, or later if CSR is not to be

Class: String (Ruby 2.6), 4223?v=4. Fix CI error with minitest 5.14 · #38227 4223?v=4. Define mattr_* methods at caller's location Fix undefined method `start_with?' for :to_json. The issue is that the method is undefined for an object of nil::NilClass. So the issue is, again, the account entry, or account, pulling back a nil. Walking through the code, the update_balance! method is held in the account model but it is called from the account_entry model via its own customer method, update_account_balance.

undefined method `+' for nil:NilClass (NoMethodError),

  • Do you have any ruby code inside your javascript directory? Because when you use //=require_tree . if you have any error in your ruby code, you get the message you posted. For example: when you use javascript templates with .erb extension.
  • ^ that and also can you include the full trace of the error as well?
  • Thanks, but no there's no ruby code in my javascript directory that I'm aware of (app/assets/javascripts). Just the application.js file and .coffee files representing each of my models.
  • I can't add the Full trace here - too long. sprockets (3.0.1) lib/sprockets/path_utils.rb:111:in split_subpath' sprockets (3.0.1) lib/sprockets/path_utils.rb:126:in block in paths_split' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in each' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in paths_split' sprockets (3.0.1) lib/sprockets/resolve.rb:88:in resolve_relative_path' sprockets (3.0.1) lib/sprockets/resolve.rb:33:in resolve' sprockets (3.0.1) lib/sprockets/legacy.rb:66:in `resolve_with_compat' Can you suggest how I can overcome this and add the Full Trace?
  • This worked, but I'm now getting syntax errors in my controller. This is my biggest fear - I don't want to apply what I think is a solution and continue down the rabbit hole without an understanding of how each of these changes might impact the application, and I'm too new to ruby/rails to have that understanding. This all started with an installation of CarrierWave, so I'm thinking I need to ditch that gem or find an alternative. Up until then the app (seemingly) worked perfectly. Thanks for the responses. I remain extremely frustrated.
  • Came across the the same issue today. Have you figured it out @PhilMac ?
  • Yes. See below @0x4a6f4672
  • Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
  • Thanks!.. this is the REAL root cause behind the error.. I had an incorrect value in the path variable.. Initially the var for my library (no boostrap in this case) was set to "../img/". Once I fixed the path variable the rails/sprockets asset helpers were able to locate the asset correctly and move on..
  • that's merely avoiding the issue.. and would be the same as not including the bootstrap-sprockets. The real issue is there is a path variable that is incorrect which is being used by one of the asset helpers..