-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rails console on reload: undefined method `end_line=' for nil (NoMethodError) #685
Comments
I case anyone comes to this page after me, this just means you have a syntax error in your code. I got this when I got an incorrectly misplaced closing braces in a long expression in IRB. That's weird that the issue opener got this from |
I've had the same problem for years. I finally took time to research and found this very issue. To find the "syntax error" I ran this a begin
reload!
rescue => e
puts e.full_message(highlight: true, order: :top)
end and buried in the stack trace was the line of my problematic application code: FactoryBot.define do
factory :coords do
x {123}
y {456} # <=== this is the problematic line!
end
end It turns out Lines 4 to 7 in ac15c01
I can make my factory work by changing my factory from |
@pedros007 thank you so much for posting this. i just confirmed this to be the root cause on my end as well. i have a grid system which stores the length and height in x and y and i totally will not change this on my end because that would mean ripping apart the guts and a nightmare to put it all back together FactoryBot.define do
factory :widget do
dashboard { nil }
x { 1 }
y { 1 }
width { 1 }
height { 1 }
category { 1 }
config { "" }
end
end i agree that psych should not be using just y here. |
Hi,
everytime i reload! the rails console i get this error:
it was annoying but didnt bother me enough to dig a little deeper. but today was the day. so i searched my whole computer for that line and ended up in the psych gem folder right here:
psych/lib/psych/tree_builder.rb
Line 134 in ea79a95
it is obviously not the actual cause of the issue but has anyone an idea how i could figure out where the issue is?
thanks in advance!
The text was updated successfully, but these errors were encountered: