<Guest93>
hello, trying out the tutorial http://railscasts.com/episodes/250-authentication-from-scratch gave problems with Ruby 3.1.2p20 and Rails 7.0.3.1. Saving the user entity will make the attribut email nil. In Rails Console the behavior is the same. How can i fix it?
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 268 seconds]
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
jpn has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 252 seconds]
arg_ has joined #ruby
Guest93 has quit [Quit: Client closed]
twosuns has quit [Quit: Leaving]
<Ziyan_>
In Rails, I am writing specs to a helper method that calls another helper method. These helper methods are not on the same file. When I test the method that depends on the other, I get the NoMethodError. Is this normal behaviour?
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 240 seconds]
<Ziyan>
mah... I forgot to use `helper.method_name`, when i added `helper.` to the method call it worked
brahmana has joined #ruby
<brahmana>
Hi all. I am facing a somewhat weird problem with one of my Rails deployment. I am getting a "Broken Pipe" error from this file : /usr/lib/ruby/2.5.0/forwardable/impl.rb
<brahmana>
This process is being started through monit using a shell script. Oddly, if I redirect the output of the command to a file, this error does not come up.
<brahmana>
This is on Ubuntu 18.04.6 with ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux-gnu]
<brahmana>
To add a little more info about my question : The line which is raising a Broken Pipe error is this : iseq = RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)
<brahmana>
From what I understand it is just compiling a small ruby snippet. I am not able to figure out what could possibly cause a Broken Pipe error here.
<brahmana>
I tried looking into the relevant C code but nothing stood out to me.
* brahmana
is in no way fluent / familar with Ruby sources but can only try to see if something obvious can be spotted.
<Zerock>
the redirection thing is suspicious. How are you actually executing your program?
<Zerock>
I also know nothing of rails but that seems like it is losing the terminal somehow
<brahmana>
I have a shell script which initially sets a bunch of ENV vars and then invokes my ruby script. The command has a & at the end to put the process in BG. So losing the terminal is correct.
<Zerock>
does your shell script `wait` for the background thread to complete?
<Zerock>
or are you using & as a way to daemonize it?
<brahmana>
No, not really. The line that runs the ruby script is the last line. However this shell script is actually run by monit which daemonizes the process i.e. makes init the parent
<brahmana>
What's surprising for me is that this has not been a problem for almost 2+ years and has suddenly cropped up now.
<Zerock>
I would say to just remove & then and let it be in the foreground. It sounds like monit is daemonizing the shell script but when that terminates, the application is left without a terminal. You need to either redirect that or make the shell script wait for it to preserve the terminal
<Zerock>
that is to say, monit is making init the parent of the script, but not the application
<Zerock>
the application depends upon the script, but that quickly exits after starting the application
<brahmana>
Oh ok..
<Zerock>
that's my guess. I don't know the workings of monit, but the symptoms are right for that situation
<brahmana>
IIRC, we explicitly added & otherwise monit would complain that the `start script` did not `return` or `complete`
<Zerock>
hmm
<Zerock>
I don't know then
<brahmana>
Btw, what is the requirement here for a terminal?
<Zerock>
the application is trying to write to stdout, but the target for stdout is lost, and this throws an i/o error
<Zerock>
you could just redirect it to a log file, or if you don't care about the output, redirect it to /dev/null
<brahmana>
This line `RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)` tries to write to stdout, is it?
<Zerock>
either that or something down the calling stack
<brahmana>
hmm.. ok.. I wonder if it is something to do with this specific ruby version which did not exist in the yesteryears
<Zerock>
possibly
<Zerock>
I'm very new to ruby myself but have experienced similar issues with other applications in the past
<Zerock>
it's also possible that a new version fixes it. I don't know if ubuntu has backports repos like debian you could try
<brahmana>
Will check that.
<brahmana>
Ok. Cool. I will keep the redirection in place for now since it is working. Will try to post this in the mailing list and see if somebody can point out the deeper cause.
<brahmana>
Thank you very much Zerock
<Zerock>
no problem, good luck!
brahmana has quit [Remote host closed the connection]
Mikaela is now known as Aminda
dionysus69 has quit [Ping timeout: 240 seconds]
Inoperable has joined #ruby
Inoperable has quit [Quit: All your buffer are belong to us!]
dionysus69 has joined #ruby
Inoperable has joined #ruby
John_Ivan has quit [Remote host closed the connection]
jl- has joined #ruby
jl- has quit [Ping timeout: 268 seconds]
<moo>
tried out rails again today, and wow this time it didn't install 12 gb of javascript and didn't require nodejs :)
<moo>
life's good now
<adam12>
Import maps are definitely a nice improvement.
protektwar has quit [Ping timeout: 240 seconds]
<moo>
normally i use sinatra but this might be good time for me haha
<adam12>
I've been using Sinatra more lately. I forgot how much I enjoyed it.
<adam12>
I use Roda in almost everything else, but there's something about looking at a list of routes and knowing how everything is going to match.
<moo>
oh interesting, made by the same author as sequel , my another favorite
John_Ivan has joined #ruby
<adam12>
Sinatra could have a few things that I think would make it way better. I know they are opting for stable, but it's definitely missing some core pieces.
<adam12>
Like flash messages.
<moo>
does eg. rails handle them in some special way?
<adam12>
They ship with sessions. It seems like flash messages is a natural addition to that.
<moo>
usually i just had some kind of variable passed to template and eg. layout.erb would check for flash message and do stuff
<adam12>
Handle what in some special way?
<adam12>
It's a special type of Hash that's cleared between requests.
<adam12>
But it has a few more bits, like ability to set the _next_ hash with values without disrupting the current one.
<adam12>
It's just surprising that it doesn't come with one. Every other implementation looks abandoned.
<adam12>
If you compare it to Flask (from Python), it includes one. And some other nice bits.
<adam12>
If hanami-router and hanami-controller v2-stable drop, I might just switch to using them for new projects.
arg_ has quit [Quit: Connection closed for inactivity]
brahmana has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
brahmana has quit [Ping timeout: 252 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
dviola has quit [Ping timeout: 245 seconds]
jpn has quit [Ping timeout: 240 seconds]
moldorcoder7 has quit [Ping timeout: 245 seconds]
moldorcoder7 has joined #ruby
fef has joined #ruby
fef has quit [Remote host closed the connection]
fef has joined #ruby
dviola has joined #ruby
Guest93 has joined #ruby
pgib has joined #ruby
dionysus69 has joined #ruby
markong has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 240 seconds]
Guest93 has quit [Quit: Client closed]
dviola has left #ruby [WeeChat 3.6]
dviola has joined #ruby
TomyWork has quit [Quit: Leaving]
brahmana has joined #ruby
brahmana has quit [Ping timeout: 252 seconds]
danjo007 has quit [Read error: Connection reset by peer]