Repeating Error: undefined method `start_with?' for nil:NilClass
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 '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
//= 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.
methods undefined
add a comment |
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 '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
//= 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.
methods undefined
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.
– Federico Moretti
May 1 '15 at 19:43
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
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.
– Phil_ish
May 1 '15 at 20:49
I can't add the Full trace here - too long. sprockets (3.0.1) lib/sprockets/path_utils.rb:111:insplit_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:ineach' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in
paths_split' sprockets (3.0.1) lib/sprockets/resolve.rb:88:inresolve_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?
– Phil_ish
May 1 '15 at 21:18
add a comment |
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 '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
//= 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.
methods undefined
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 '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
//= 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.
methods undefined
methods undefined
asked May 1 '15 at 19:32
Phil_ishPhil_ish
5019
5019
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.
– Federico Moretti
May 1 '15 at 19:43
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
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.
– Phil_ish
May 1 '15 at 20:49
I can't add the Full trace here - too long. sprockets (3.0.1) lib/sprockets/path_utils.rb:111:insplit_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:ineach' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in
paths_split' sprockets (3.0.1) lib/sprockets/resolve.rb:88:inresolve_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?
– Phil_ish
May 1 '15 at 21:18
add a comment |
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.
– Federico Moretti
May 1 '15 at 19:43
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
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.
– Phil_ish
May 1 '15 at 20:49
I can't add the Full trace here - too long. sprockets (3.0.1) lib/sprockets/path_utils.rb:111:insplit_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:ineach' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in
paths_split' sprockets (3.0.1) lib/sprockets/resolve.rb:88:inresolve_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?
– Phil_ish
May 1 '15 at 21:18
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.
– Federico Moretti
May 1 '15 at 19:43
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.
– Federico Moretti
May 1 '15 at 19:43
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
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.
– Phil_ish
May 1 '15 at 20:49
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.
– Phil_ish
May 1 '15 at 20:49
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?– Phil_ish
May 1 '15 at 21:18
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?– Phil_ish
May 1 '15 at 21:18
add a comment |
8 Answers
8
active
oldest
votes
I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-spockets". Commenting this out solved it for me.
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
add a comment |
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.
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..
– Urkle
Dec 16 '15 at 21:55
add a comment |
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";
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..
– Urkle
Dec 16 '15 at 21:53
add a comment |
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.
add a comment |
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');
add a comment |
In my case, the problem was actually that sprockets-rails
was looking to load a non-existent path. This was happening because I passed a regex to the list of assets to precompile and sprocket-rails
made a bad guess as to the asset's relative path. More information in this issue here:
https://github.com/rails/sprockets-rails/issues/269
add a comment |
bower-rails
gem was causing it for me.
probable reason:
bower was attempting to load a non-existent path
just commented out the gem and its config files for now.
a precise probe to pin-pointing of the cause remains subject to available time. bower-rails is not so critical for the project right now.
add a comment |
I've just found what was wrong. The issue came with typescript
compile.
Suppose that you have a function to give json
response as following
const getSomething = () => {
return { a: 1, b: 2, c: 3}
}
And you might want to define variables like this
let something = getSomething()
let {a, b, c} = something
In my case, the above code made the issue in rails assets precompile for typescript, even though it's correct in syntax of it. But the following code does work properly
let {a, b, c} = getSomething()
I hope this would help someone who got this kind of issues.
Thanks
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29993823%2frepeating-error-undefined-method-start-with-for-nilnilclass%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-spockets". Commenting this out solved it for me.
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
add a comment |
I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-spockets". Commenting this out solved it for me.
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
add a comment |
I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-spockets". Commenting this out solved it for me.
I came across this same issue myself maybe my solution will help you out. Check your /app/assets/stylesheets/application.scss file for "bootstrap-spockets". Commenting this out solved it for me.
answered May 8 '15 at 19:32
TheRealSeanReidTheRealSeanReid
314
314
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
add a comment |
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
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.
– Phil_ish
May 11 '15 at 19:15
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.
– Phil_ish
May 11 '15 at 19:15
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Came across the the same issue today. Have you figured it out @PhilMac ?
– 0x4a6f4672
Jun 29 '15 at 12:16
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yes. See below @0x4a6f4672
– Phil_ish
Jul 2 '15 at 15:07
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
Yeah, uncommenting "bootstrap-sprockets" solved it, but appeared to be a strange problem
– 0x4a6f4672
Jul 2 '15 at 15:14
add a comment |
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.
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..
– Urkle
Dec 16 '15 at 21:55
add a comment |
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.
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..
– Urkle
Dec 16 '15 at 21:55
add a comment |
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.
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.
answered Jun 30 '15 at 5:28
Mischa ColleyMischa Colley
108112
108112
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..
– Urkle
Dec 16 '15 at 21:55
add a comment |
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..
– Urkle
Dec 16 '15 at 21:55
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..
– Urkle
Dec 16 '15 at 21:55
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..
– Urkle
Dec 16 '15 at 21:55
add a comment |
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";
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..
– Urkle
Dec 16 '15 at 21:53
add a comment |
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";
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..
– Urkle
Dec 16 '15 at 21:53
add a comment |
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";
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";
answered Jul 13 '15 at 11:32
0x4a6f46720x4a6f4672
15.6k1184115
15.6k1184115
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..
– Urkle
Dec 16 '15 at 21:53
add a comment |
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..
– Urkle
Dec 16 '15 at 21:53
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..
– Urkle
Dec 16 '15 at 21:53
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..
– Urkle
Dec 16 '15 at 21:53
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered May 22 '15 at 18:29
Phil_ishPhil_ish
5019
5019
add a comment |
add a comment |
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');
add a comment |
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');
add a comment |
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');
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');
answered Jan 10 '16 at 23:44
leishmanleishman
75967
75967
add a comment |
add a comment |
In my case, the problem was actually that sprockets-rails
was looking to load a non-existent path. This was happening because I passed a regex to the list of assets to precompile and sprocket-rails
made a bad guess as to the asset's relative path. More information in this issue here:
https://github.com/rails/sprockets-rails/issues/269
add a comment |
In my case, the problem was actually that sprockets-rails
was looking to load a non-existent path. This was happening because I passed a regex to the list of assets to precompile and sprocket-rails
made a bad guess as to the asset's relative path. More information in this issue here:
https://github.com/rails/sprockets-rails/issues/269
add a comment |
In my case, the problem was actually that sprockets-rails
was looking to load a non-existent path. This was happening because I passed a regex to the list of assets to precompile and sprocket-rails
made a bad guess as to the asset's relative path. More information in this issue here:
https://github.com/rails/sprockets-rails/issues/269
In my case, the problem was actually that sprockets-rails
was looking to load a non-existent path. This was happening because I passed a regex to the list of assets to precompile and sprocket-rails
made a bad guess as to the asset's relative path. More information in this issue here:
https://github.com/rails/sprockets-rails/issues/269
answered Jul 9 '16 at 5:23
progfanprogfan
1,27221422
1,27221422
add a comment |
add a comment |
bower-rails
gem was causing it for me.
probable reason:
bower was attempting to load a non-existent path
just commented out the gem and its config files for now.
a precise probe to pin-pointing of the cause remains subject to available time. bower-rails is not so critical for the project right now.
add a comment |
bower-rails
gem was causing it for me.
probable reason:
bower was attempting to load a non-existent path
just commented out the gem and its config files for now.
a precise probe to pin-pointing of the cause remains subject to available time. bower-rails is not so critical for the project right now.
add a comment |
bower-rails
gem was causing it for me.
probable reason:
bower was attempting to load a non-existent path
just commented out the gem and its config files for now.
a precise probe to pin-pointing of the cause remains subject to available time. bower-rails is not so critical for the project right now.
bower-rails
gem was causing it for me.
probable reason:
bower was attempting to load a non-existent path
just commented out the gem and its config files for now.
a precise probe to pin-pointing of the cause remains subject to available time. bower-rails is not so critical for the project right now.
answered Mar 5 '17 at 19:34
ramonrailsramonrails
1,0201018
1,0201018
add a comment |
add a comment |
I've just found what was wrong. The issue came with typescript
compile.
Suppose that you have a function to give json
response as following
const getSomething = () => {
return { a: 1, b: 2, c: 3}
}
And you might want to define variables like this
let something = getSomething()
let {a, b, c} = something
In my case, the above code made the issue in rails assets precompile for typescript, even though it's correct in syntax of it. But the following code does work properly
let {a, b, c} = getSomething()
I hope this would help someone who got this kind of issues.
Thanks
add a comment |
I've just found what was wrong. The issue came with typescript
compile.
Suppose that you have a function to give json
response as following
const getSomething = () => {
return { a: 1, b: 2, c: 3}
}
And you might want to define variables like this
let something = getSomething()
let {a, b, c} = something
In my case, the above code made the issue in rails assets precompile for typescript, even though it's correct in syntax of it. But the following code does work properly
let {a, b, c} = getSomething()
I hope this would help someone who got this kind of issues.
Thanks
add a comment |
I've just found what was wrong. The issue came with typescript
compile.
Suppose that you have a function to give json
response as following
const getSomething = () => {
return { a: 1, b: 2, c: 3}
}
And you might want to define variables like this
let something = getSomething()
let {a, b, c} = something
In my case, the above code made the issue in rails assets precompile for typescript, even though it's correct in syntax of it. But the following code does work properly
let {a, b, c} = getSomething()
I hope this would help someone who got this kind of issues.
Thanks
I've just found what was wrong. The issue came with typescript
compile.
Suppose that you have a function to give json
response as following
const getSomething = () => {
return { a: 1, b: 2, c: 3}
}
And you might want to define variables like this
let something = getSomething()
let {a, b, c} = something
In my case, the above code made the issue in rails assets precompile for typescript, even though it's correct in syntax of it. But the following code does work properly
let {a, b, c} = getSomething()
I hope this would help someone who got this kind of issues.
Thanks
answered Nov 15 '18 at 3:52
PerfectPerfect
629617
629617
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29993823%2frepeating-error-undefined-method-start-with-for-nilnilclass%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
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.
– Federico Moretti
May 1 '15 at 19:43
^ that and also can you include the full trace of the error as well?
– Julio G Medina
May 1 '15 at 19:59
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.
– Phil_ish
May 1 '15 at 20:49
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:ineach' sprockets (3.0.1) lib/sprockets/path_utils.rb:125:in
paths_split' sprockets (3.0.1) lib/sprockets/resolve.rb:88:inresolve_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?– Phil_ish
May 1 '15 at 21:18