dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
i1nfusion1 has quit [Remote host closed the connection]
i1nfusion1 has joined #ruby
dar123 has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
quarters has joined #ruby
AJA4350 has quit [Quit: AJA4350]
<quarters>
hello. I'm having an issue with running pry without readline and was wondering what the standard solution for this si
<quarters>
this is on linux
cdr255 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
quarters: Likely rb-readline
<quarters>
adam12, I just tried installing rb-readline, but I'm getting the same error
<quarters>
Sorry, you can't use Pry without Readline or a compatible library.
<quarters>
Possible solutions:
<quarters>
* Rebuild Ruby with Readline support using `--with-readline`
<quarters>
* Use the rb-readline gem, which is a pure-Ruby port of Readline
<quarters>
* Use the pry-coolline gem, a pure-ruby alternative to Readline
<adam12>
quarters: How'd you install rb-readline?
<quarters>
gem install rb-readline
<adam12>
quarters: and how are you running pry?
<quarters>
pry
<thejamespinto>
lol
<adam12>
quarters: Are you using bundler / gem_home / etc?
<quarters>
bundler
<adam12>
quarters: But not to run pry?
<quarters>
like "bundle exec pry"?
<thejamespinto>
adam12: Did you use RVM or RBENV to install your Ruby? It's quite useful and by the amount of information I have I can't fully assess your level
<quarters>
adam12, I had tried it with the same issue
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
quarters: How about running pry with -rreadline
<adam12>
I always just ensure that readline is available (or libedit :\) so I haven't ran into this case before.
<adam12>
thejamespinto: That was definitely directeded to me?
<quarters>
adam12, like "pry -rreadline"? I just tried it and got an error there as well
<adam12>
quarters: Same error?
<quarters>
kind of different, but the underlying error is the same I think: libreadline.so.7: cannot open shared object file: No such file or directory - /home/quarters/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/x86_64-linux/readline.so (LoadError)
<adam12>
quarters: Ah interesting. Does that file exist?
<adam12>
(the readline.so not the libreadline.so.7)
<quarters>
yes, it does
<thejamespinto>
adam12: as I said, I can't fully assess your level with of skill with Ruby. I can tell you're skilled at Linux. Please, take no offense
<adam12>
thejamespinto: No offese taken, just confusion. I'm familiar with Ruby. I've published some things. github.com/adam12
<adam12>
quarters: Just a few more questions, sadly.
<thejamespinto>
;)
<quarters>
adam12, sure
<adam12>
quarters: Recent install of Ruby via RVM? Is there a reason why you can't install libreadline? Did this ever work?
i1nfusion1 has quit [Remote host closed the connection]
<adam12>
quarters: The fact that readline.so exists but libreadline.so.7 doesn't isn't right. I don't think readline.so would ever exist without the Ruby compiler detecting libreadline during the running of configure/autoconf.
<quarters>
adam12, it's been awhile since I've touched ruby. is libreadline also a ruby gem?
<quarters>
or is that a system package
<adam12>
quarters: The way Ruby works is, it tries the $LOAD_PATH for files matching $name.rb or $name.so. Your $name.so is conflicting with the Ruby gem you installed that's called readline.rb.
<adam12>
quarters: It's a system package.
orbyt_ has joined #ruby
<quarters>
I'll try to hunt it down and install it
<quarters>
readline appears to already be installed
<quarters>
readline 8 for arch linux
<quarters>
I'll reinstall it
<adam12>
quarters: Maybe the library changed path?
<quarters>
I'm fine with reinstalling ruby. is that course ill-advised?
<quarters>
removing it and reinstalling a more current version
<adam12>
quarters: If you for sure have libreadline installed, then a reinstall of Ruby is likely easiest.
<quarters>
ok. I'm uninstalling it now
<thejamespinto>
adam12: I'm a community manager myself and I can't tell you how many weird cases I've seen of people who've been tasked with making a ruby project run and they get lost in the details of installation. :( You're an awesome minority when it comes to having actual relevant questions when it comes to readline :)
<adam12>
thejamespinto: All I had to do was give my head a shake and some painful memories about readline came falling out.
<adam12>
:)
<adam12>
thejamespinto: I'm excited for the work on the new edit mode one of the Ruby core members is working on to replace readline with a better line editor (multi line editor?)
<quarters>
adam12, uninstalling and reinstalling ruby fixed it
<adam12>
quarters: Just out of curiosity, would you mind running this inside pry? $LOADED_FEATURES.grep(/readline/)
<adam12>
quarters: It will either be readline.so or readline.rb...
<quarters>
readline.so
i1nfusion1 has joined #ruby
<adam12>
quarters: Yeah. Borked Ruby install. You could likely uninstall rb-readline to avoid any confusion in the future.
<thejamespinto>
adam12: personally, the sounds on the shower scene from Psycho take over me for a few seconds
dar123 has joined #ruby
<adam12>
thejamespinto: Just realised I never answered your question. I normally use ruby-install from postmodern to install my Rubies, and then use direnv with PATH_add to setup load path (and sometimes I'll set GEM_HOME/etc).
rafadc has quit [Read error: Connection reset by peer]
<adam12>
thejamespinto: But after realizing a few weeks ago that truffleruby was getting along fairly well, I upgraded ruby-install to try installing truffleruby which turned into a) truffleruby not working on FreeBSD and b) new ruby-install being borked on FreeBSD. So I am just fetching/compiling manually.
rafadc has joined #ruby
<thejamespinto>
adam12: I've handled a few Postgrad students who firmly believed Ruby is an academic language and they were shocked when I gave them a link to the ROR and RUBYGEMS sites :)
<quarters>
adam12, thanks
someuser has quit [Quit: leaving]
griffindy has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
thejamespinto: I'm not surprised tbh.
<thejamespinto>
I was the first time around
<thejamespinto>
One of them was actually confusing Ruby and R
orbyt_ has joined #ruby
mangold has joined #ruby
cd has quit [Quit: cd]
t0x has quit [Quit: Connection closed for inactivity]
connor_g1odwolf has quit [Quit: leaving]
connor_goodwolf has joined #ruby
ze-fofim is now known as \tau
<thejamespinto>
OMG! Does anybody remember how to make an attr_reader for class variables?
<adam12>
thejamespinto: Probably just `def self.some_method; @@some_method; end`
<adam12>
thejamespinto: Presumably you're talking about class variables and not class instance variables `class << self; attr_accessor :some_method; end`
<thejamespinto>
module A; module_function
<thejamespinto>
:-/
<thejamespinto>
I was sure there was a m_attr_accessor or something
<adam12>
mattr_accessor? It's a Railsism
<thejamespinto>
ohhh that's why
<thejamespinto>
I've been stuck at a silly job for the past two years while I finish my masters/phd
ro0fka has joined #ruby
<thejamespinto>
Haven't written a proper line of OSS since
<thejamespinto>
I'm right now rewriting a test sub-framework
<thejamespinto>
def filename; @filename || 'bdd’; end
<thejamespinto>
this did it
agent_white has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
i1nfusion1 has quit [Remote host closed the connection]
jottr has joined #ruby
ro0fka has left #ruby [#ruby]
amfabasti has quit []
jottr has quit [Ping timeout: 245 seconds]
i1nfusion1 has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
i1nfusion1 has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 264 seconds]
Swyper has joined #ruby
<ryouba>
hi!
marmotini_ has joined #ruby
<ryouba>
i want to `class MyDoc < Sequel; ...; def self.first_by_title(q); ...; end; end` and then use that like `entry = MyDoc.first_by_title('foobar')` and have `entry.class` be "MyDoc". but how do i return an "object of myself" at the end of that static class method? *confused*
<phaul>
call new(..)
marmotini has quit [Ping timeout: 258 seconds]
* ryouba
tries
<ryouba>
(hi phaul!)
<phaul>
hi ryouba
marmotini has joined #ruby
marmotini has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 245 seconds]
ellcs1 has quit [Ping timeout: 245 seconds]
marmotini_ has quit [Ping timeout: 252 seconds]
<phaul>
you could also just use Sequel::Model
segy has joined #ruby
aupadhye has joined #ruby
marmotini_ has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
<ryouba>
oh
<ryouba>
with new() i wasn't getting anywhere
* ryouba
googles
<ryouba>
aha, that looks like what you're *supposed* to be using
stoffus_ has joined #ruby
waheedi has quit [Quit: waheedi]
stoffus has quit [Ping timeout: 240 seconds]
Tharbakim has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
afisher has joined #ruby
esrse] has quit [Ping timeout: 252 seconds]
spiette has quit [Ping timeout: 244 seconds]
spiette has joined #ruby
<dionysus69>
hey all
<dionysus69>
any good resources where I can play with interfacing ruby with C or Rust? let's say I write hello_world method in either of them, just dont know where to start
waheedi has joined #ruby
andikr has quit [Ping timeout: 246 seconds]
beilabs_ has joined #ruby
beilabs has quit [Ping timeout: 258 seconds]
Swyper has quit [Remote host closed the connection]
<ryouba>
phaul: my solution was to rename the table. it's kind of nice for them to be having matching names. i did add a comment inside the model class, though. otherwise it's a little *too* magic.
blackmesa has joined #ruby
DmitryBochkarev has quit [Ping timeout: 250 seconds]
i1nfusion has quit [Remote host closed the connection]
i1nfusion1 has quit [Remote host closed the connection]
<marz_d`ghostman>
If I'm running rails with puma, which is the default, will I need nginx or apache?
<havenwood>
marz_d`ghostman: You don't need either, but it's common to use one or the other and reverse proxy to the Puma socket.
agent_white has quit [Quit: leaving]
agent_white has joined #ruby
<marz_d`ghostman>
havenwood: so having rails server -e production would suffice?
<marz_d`ghostman>
havenwood: Ah, I see what your saying now.
yield has joined #ruby
<havenwood>
marz_d`ghostman: assuming you want to use ssl, you'll also need: -b 'ssl:...crt'
DmitryBochkarev has quit [Ping timeout: 250 seconds]
nwradio878887 has joined #ruby
yield has quit [Ping timeout: 250 seconds]
nwradio87888 has quit [Ping timeout: 245 seconds]
<havenwood>
marz_d`ghostman: There are various reasons you might want to put NGINX in front. You can serve static files directly (not through Rack), it provides HTTP/2 support, SSL works easily with certbot, etc. But of course Apache and NGINX are a huge pain to configure. ¯\_(ツ)_/¯
<havenwood>
marz_d`ghostman: You can basically get those same benefits by putting Cloudflare in front too.
<havenwood>
Static files, HTTP/2 and easy SSL - check, check and check.
<marz_d`ghostman>
havenwood: I agree, I'm currently running my rails app inside docker and setup nginx on this server
<adam12>
I've become preferential to Caddy, tho they can't seem to decide how they want to license it. Building from source (or using a package manager) gets you the Apache license tho, which is decent.
<marz_d`ghostman>
havenwood: A real pain setting it up :)
<havenwood>
adam12: Interesting! I'd not seen Caddy.
ldnunes has quit [Quit: Leaving]
<adam12>
havenwood: Reverse proxy + auto ssl is super simple. Most of my Caddyfile configs are 2-4 lines.
ldnunes has joined #ruby
nowhere_man has joined #ruby
<adam12>
havenwood: It supports on-demand TLS negotiation as well, which is nice if you offer custom domains+SSL on projects. You can setup a hook in Caddy to ask your app if it's a legit hostname that requires TLS, and if it is, Caddy handles the LetsEncrypt request and live reloading / serving of the new certificate during the TLS handshake.
<Zarthus>
adam12: I used to be a caddy fanatic but the fact they ever thought sponsoring in their headers was a good idea kinda ruined my trust in them
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
Zarthus: To some degree I'm with ya. I'm not sure why it's taken so long for everyone to catch up to them in regards to configuration + auto SSL tho. Maybe the new Passenger will get there.
<adam12>
havenwood: I'm enjoying Iodine a lot, tho I've been following Falcon.
blackmesa has joined #ruby
kyrylo has joined #ruby
luminousnine has quit [Ping timeout: 252 seconds]
waheedi has joined #ruby
xfbs has quit [Ping timeout: 264 seconds]
hiroaki has joined #ruby
TvL2386_ has joined #ruby
TvL2386 has quit [Ping timeout: 250 seconds]
luminousnine has joined #ruby
luminousnine has joined #ruby
luminousnine has quit [Changing host]
xfbs has joined #ruby
yield has joined #ruby
<brool>
if i have a string like "R and G and Blue" can i use a single regexp to get an array like ["R", "G", "B"] or do i have to iterate over the string's characters to do that?
<brool>
i can't figure out how to capture more than the 1st result with #match
<brool>
if i'm looking for /[RGB]/
dviola has joined #ruby
<adam12>
brool: .scan(/[RGB]+/) will likely work.
<brool>
i'll check
<adam12>
brool: Could likely leave off the +. .scan(/[RGB]/)
<brool>
that's exactly what i needed thanks
<brool>
i was at a loss when the standard /g flag was not recognized
eddof13 has quit [Quit: eddof13]
doodlebug has quit [Read error: Connection reset by peer]
yield has quit [Ping timeout: 268 seconds]
doodlebug has joined #ruby
<havenwood>
brool: for that particular example, you could also use a glob
<havenwood>
&>> 'R and G and Blue'.delete('^RGB').chars
<TheSin>
anyone have any idea how to fix "LoadError: cannot load such file -- kubeclient/oidc_auth_provider" when it's kubeclient.rb that is calling a require on kubeclient/oidc_auth_provider and it's present?
carbone5 has quit [Quit: carbone5]
t0xik has joined #ruby
dellavg_ has quit [Ping timeout: 245 seconds]
zachk has joined #ruby
<leftylink>
to see where ruby is looking for files that are `require`d, you may find it useful to look at the value of $LOAD_PATH . it sounds like a directory is not in there that should be.
zachk has quit [Changing host]
zachk has joined #ruby
<leftylink>
as for how to get a directory in there that needs to be, I yield the floor
Swyper has quit [Remote host closed the connection]
orbyt_ has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
nowhere_man has quit [Ping timeout: 252 seconds]
segy has joined #ruby
yield has joined #ruby
waheedi has quit [Quit: waheedi]
marz_d`ghostman has quit [Quit: Page closed]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
fredolinhares has joined #ruby
Swyper has joined #ruby
yield has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
eddof13 has joined #ruby
Swyper has joined #ruby
gb_away_ has quit [Quit: One disk to rule them all, One disk to bind them, One disk to hold the files And in the darkness grind 'em.]
jottr has joined #ruby
gb_away has joined #ruby
fluxAeon has quit [Ping timeout: 246 seconds]
fredolinhares has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
eddof13 has quit [Quit: eddof13]
ldnunes has quit [Quit: Leaving]
<TheSin>
leftylink, I can't see that cause there are like 8 includes in kubeclient.h before that one from the same dir is that one since it's part of the package, it's making me nuts though
<cthulchu_>
my wonderful Ruby folks! Do you use STDOUT.flush?
Swyper has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 252 seconds]
eddof13 has joined #ruby
Code_[24]_ has joined #ruby
<hahuang65>
cthulchu_ occassionally. depends on what I'm doing.
conta has quit [Ping timeout: 252 seconds]
yield has joined #ruby
<cthulchu_>
hahuang65, have you ever felt either that the flush changes the output, either the timing or the order OR that flush causes any measurable performance issues?
doodleb10 has joined #ruby
TheSin has quit [Quit: Client exiting]
doodlebug has quit [Ping timeout: 245 seconds]
yield has quit [Ping timeout: 245 seconds]
<hahuang65>
cthulchu_ I don't use flush in anything production. i mainly use it in local scripts. I've never noticed it change the timing or order of logs, but I suppose it's possible.
<cthulchu_>
ye
hiroaki has quit [Ping timeout: 252 seconds]
<cthulchu_>
I'm about to use it just to have the parent process reading the output line by line
<cthulchu_>
otherwise the stdout.on("data") doesn't get triggered until stdout is closed
Swyper has joined #ruby
Swyper has quit [Ping timeout: 250 seconds]
jrafanie has joined #ruby
houhoulis has quit [Remote host closed the connection]
themsay has joined #ruby
jottr has joined #ruby
yield has joined #ruby
schleppel has quit [Quit: Konversation terminated!]