havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
troulouliou_div2 has quit [Remote host closed the connection]
Arkantos has joined #ruby
s3nd1v0g1us has joined #ruby
TCZ has joined #ruby
troulouliou_div2 has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
dviola has quit [Ping timeout: 264 seconds]
ur5us has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
troulouliou_div2 has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troulouliou_div2 has joined #ruby
s3nd1v0g1us has quit [Quit: WeeChat 2.6]
alfiemax has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
<xco> havenwood the encodings are doing some weird stuff have a look https://gyazo.com/be599159281c5ba2891114102e30e6ad
<xco> see the alignment of the | on the header shifts inwards
<xco> perhaps you know why?
<xco> with the flags it's like that without it it's fine
ferche23 has joined #ruby
ferche23_ has joined #ruby
TCZ has quit [Quit: Leaving]
<havenwood> xco: Is it perhaps counting codepoints, so it assumes a two-codepoint emoji is wider than it is"
ferche23 has quit [Max SendQ exceeded]
ferche23_ has quit [Client Quit]
<xco> havenwood if it's wider shouldn't the | shift outwards?
<havenwood> Sorry for all the typos today, but holding sleeping baby. :)
<havenwood> xco: It may presume the emoji adds the padding.
ferche23 has joined #ruby
<havenwood> &>> '🇺🇸'.size
<rubydoc> # => 2 (https://carc.in/#/r/8rh7)
<xco> yeah i know the size is 2
<xco> that i understand
<havenwood> &>> '🇺🇸'.bytesize
<rubydoc> # => 8 (https://carc.in/#/r/8rh8)
ferche23 has quit [Max SendQ exceeded]
<havenwood> xco: Have you checked the spacing logic? What does it use?
<xco> for the table gem?
<xco> i haven't looked at the code for it
ferche23 has joined #ruby
<havenwood> xco: I'd do that! I bet you can spot the logic, then all will reveal itself.
<xco> digging into it
<havenwood> xco: My guess, it's using `.size` and it should be doing `.grapheme_clusters.size`.
<havenwood> xco: #grapheme_clusters was added a few years back.
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<havenwood> &>> '🇺🇸'.grapheme_clusters.size
<rubydoc> # => 1 (https://carc.in/#/r/8rh9)
ule has joined #ruby
<xco> to calculate widths of cells
<xco> oh i see
<xco> look
<xco> Unicode::DisplayWidth.of "🤾🏽‍♀️", 1, {}, emoji: true # => 2
<xco> it counts it as 2
<xco> it should be 1 correct?
<xco> per the snippet you showed me
meowzus has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<xco> havenwood using grapheme_clusters.size
wildtrees has quit [Quit: Leaving]
TCZ has joined #ruby
<havenwood> xco: Yeah, I think that's the culprit.
<xco> i can try to fork this, change that to whatever value it is -1
<xco> to see if it works
<xco> what do you think?
<xco> unless you know of something better
<havenwood> xco: Fixing the upstream gem with a PR seems ideal. It might be hard if they support old Rubies. Another option might be to use a zero-width character that it'll count as 1.
<xco> ok i'm not well-versed with this encoding stuff so i'll fork and test locally to see if it works in the first place
<xco> they support ruby 1.9 i think
<xco> havenwood plus I was writing with Nate the last time, he said they are done with this gem, so i doubt a PR makes any sense
cd has joined #ruby
howlcode has joined #ruby
drincruz has joined #ruby
howlcode has left #ruby [#ruby]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> xco: A quick and dirty fix might be a single-width character. Alternatively, maybe consider dropping the gem and writing a small class to do just this.
xco has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 264 seconds]
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
Retr0Punk_ has quit [Quit: ZNC 1.7.3 - https://znc.in]
Arkantos has joined #ruby
jingjinghack has joined #ruby
OverClocked has joined #ruby
<OverClocked> apotheon: good info. I feel like the data would be fairly important and wouldnt want any corruptions
wildtrees has joined #ruby
wildtrees has quit [Remote host closed the connection]
TCZ has quit [Quit: Leaving]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 246 seconds]
drincruz has quit [Ping timeout: 246 seconds]
armatechnicos has quit [Read error: Connection reset by peer]
unreal has quit [Ping timeout: 258 seconds]
unreal has joined #ruby
dviola has quit [Quit: WeeChat 2.7.1]
drincruz has joined #ruby
ChmEarl has quit [Quit: Leaving]
tau has quit [Remote host closed the connection]
drincruz_ has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
drincruz has joined #ruby
drincruz_ has quit [Read error: Connection reset by peer]
drincruz has quit [Ping timeout: 240 seconds]
marz_d`ghostman has joined #ruby
<marz_d`ghostman> I'm looking for the gem used in here: https://oss.oetiker.ch/rrdtool/prog/rrdruby.en.html `rrdruby` doesn't seem to be available when I install it via gem install rrdruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brool has quit [Ping timeout: 246 seconds]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
alfiemax has joined #ruby
kt2 has joined #ruby
kt2 has quit [Client Quit]
dinfuehr has quit [Ping timeout: 264 seconds]
polishdub has joined #ruby
code_zombie has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
hiroaki has quit [Ping timeout: 264 seconds]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
<apotheon> OverClocked: Just so you know, the primary problem with MongoDB is if you have multiple nodes, though there are other guarantees in well-designed RDBMSes like PostgreSQL, helpful for ensuring no integrity issues in case of power failure during an update to the database for instance, that things like MongoDB aren't as good at recovering.
<apotheon> OverClocked: In general, if I need a database and I don't have a specific reason to do otherwise, I just default to either SQLite or PostgreSQL (largely depending on scale and resource constraints, I suppose).
cliluw has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ruby
iNs has quit [Ping timeout: 240 seconds]
iNs_ has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
Azure has quit [Quit: Textual IRC Client: www.textualapp.com]
GodFather has quit [Ping timeout: 256 seconds]
drincruz has joined #ruby
GodFather has joined #ruby
drincruz has quit [Ping timeout: 258 seconds]
ferche23 has quit [Read error: Connection reset by peer]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
_whitelogger has joined #ruby
Azure has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
ua has quit [Ping timeout: 240 seconds]
polishdub has quit [Quit: leaving]
jmcgnh has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
ua has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
sauvin has joined #ruby
sauvin_ has joined #ruby
sauvin has quit [Ping timeout: 264 seconds]
tsujp has joined #ruby
roadie has joined #ruby
sauvin_ is now known as Sauvin
tsujp_ has joined #ruby
tsujp has quit [Read error: No route to host]
tsujp has joined #ruby
TzilTzal has joined #ruby
TzilTzal has quit [Client Quit]
tsujp_ has quit [Ping timeout: 256 seconds]
TzilTzal has joined #ruby
cthu| has quit [Ping timeout: 246 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fercell has joined #ruby
alfiemax has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
cockadopolous has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
cockadopolous has joined #ruby
ur5us has joined #ruby
tpanarch1st has quit [Ping timeout: 264 seconds]
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
conta has joined #ruby
schne1der has joined #ruby
cliluw has joined #ruby
gix has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
alfiemax has quit [Remote host closed the connection]
arahael2 has joined #ruby
iNs_ has quit [Remote host closed the connection]
iNs has joined #ruby
arahael1 has quit [Ping timeout: 256 seconds]
sergioro has quit [Quit: leaving]
chalkmonster has joined #ruby
alfiemax has joined #ruby
tsujp_ has joined #ruby
ldepandis has joined #ruby
tsujp has joined #ruby
tsujp_ has quit [Ping timeout: 258 seconds]
tsujp__ has joined #ruby
tsujp has quit [Ping timeout: 250 seconds]
tsujp__ has quit [Ping timeout: 250 seconds]
TomyWork has joined #ruby
alfiemax has quit [Remote host closed the connection]
vondruch has joined #ruby
cschneid has quit [Quit: ZNC 1.7.5 - https://znc.in]
dionysus69 has joined #ruby
iNs_ has joined #ruby
iNs has quit [Remote host closed the connection]
OverClocked has quit [Ping timeout: 260 seconds]
cschneid has joined #ruby
tsujp has joined #ruby
r3m is now known as Pascal
jacksop has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CrazyEddy has quit [Ping timeout: 250 seconds]
ur5us has quit [Ping timeout: 260 seconds]
CrazyEddy has joined #ruby
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
Sauvin has quit [Ping timeout: 240 seconds]
Sauvin has joined #ruby
Sauvin is now known as Sauvin
NODE has quit [Quit: changing servers]
yokel has quit [Ping timeout: 246 seconds]
yokel has joined #ruby
NODE has joined #ruby
dlyund has joined #ruby
<dlyund> :-) Hi all. Could anyone tell me whether it's safe to read from a hash table in multiple threads while writing in a single thread (controlled by a Queue)?
postmodern has quit [Quit: Leaving]
conta has quit [Quit: conta]
<hackeron> Hi there, I have a strange issue, when I run this method: tether-it(dev)> Agent.notify_users_agent_state -- I get: ArgumentError: wrong number of arguments (given 2, expected 1) from /usr/local/Cellar/ruby/2.7.0/lib/ruby/2.7.0/forwardable.rb:130:in `instance_delegate' --- nothing else in the traceback, tearing my hair out trying to figure out the cause, any ideas?
NODE has quit [Quit: changing servers]
NODE has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
cschneid has joined #ruby
dlyund has quit [Ping timeout: 250 seconds]
<xco> what's Ruby inbuilt "pry"? i forgot
<xco> :D
dlyund has joined #ruby
marz_d`ghostman has quit [Ping timeout: 256 seconds]
<phaul> irb
<xco> phaul i know, but i think ruby has one to set breakpoints right?
<xco> like the way you'd use binding.pry
markopasha has quit [Read error: Connection reset by peer]
markopasha has joined #ruby
<ytti> xco, binding.irb
vondruch has quit [Ping timeout: 250 seconds]
<xco> ytti THAT!! thank you :)
jcalla has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.7.1]
dlyund has quit [Ping timeout: 260 seconds]
jcalla has joined #ruby
Technodrome has joined #ruby
schne1der has quit [Remote host closed the connection]
jacksop has quit []
burningserenity has joined #ruby
schne1der has joined #ruby
drincruz has joined #ruby
OverClocked has joined #ruby
cd has quit [Quit: cd]
alfiemax has joined #ruby
conta has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
chalkmonster has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v3.8 Beta Build (2020/03/24 UTC) 64 Bit]
Tempesta has joined #ruby
TzilTzal has quit [Quit: Leaving.]
kristian_on_linu has joined #ruby
reyfi9e has quit [Ping timeout: 260 seconds]
reyfi9e has joined #ruby
dlyund has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
dlyund has left #ruby [#ruby]
coniptor has joined #ruby
jingjinghack has quit [Ping timeout: 240 seconds]
jingjinghack has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
GodFather has quit [Remote host closed the connection]
leitz has joined #ruby
vondruch has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
GodFather has joined #ruby
cschneid has quit [Ping timeout: 250 seconds]
cschneid has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
brool has joined #ruby
jmcgnh has joined #ruby
f3ttX] has joined #ruby
pupsikov has joined #ruby
conta has quit [Quit: conta]
caterfxo has quit [Remote host closed the connection]
burningserenity has quit [Ping timeout: 264 seconds]
Intelo has joined #ruby
<Intelo> Hi
<Intelo> Can anyone tell whats wrong here? https://paste.ubuntu.com/p/dhztz7qjsC/
lucasb has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
hassox has joined #ruby
<adam12> Intelo: Any backstory? Did it just start occuring? Has anything changed?
<leitz> Intelo, this the same Redmine update?
hassox has quit [Ping timeout: 256 seconds]
<Intelo> adam12, leitz This is about redmine. I am trying to install plugins that require the command on line 1
OverClocked has quit [Ping timeout: 250 seconds]
GodFather has quit [Remote host closed the connection]
GodFather has joined #ruby
jingjinghack has quit [Quit: WeeChat 2.1]
<Intelo> adam12, leitz any clue why the errors?
f3ttX] has quit [Remote host closed the connection]
<leitz> Intelo, if you have the backup, I'd restore that and make sure it still runs.
<Intelo> leitz, the redmine is working fine. Its just the commands and process not working in favour from now onwards
<leitz> Intelo, I don't understand your last sentence. Is the new Redmine install working, except that the new plugin does not? Or are you back on the old Redmine?
siery has joined #ruby
<Intelo> leitz, redmine is working. When I run the commend mentioned in paste bin (during the installation of plugin), it gives the errors.
<Intelo> leitz, the core redmine is working regardles
<leitz> Intelo, okay, that makes sense. Thank you.
noboruma has quit [Ping timeout: 240 seconds]
<leitz> Intelo, line 185 makes me wonder. I don't know Redmine or Rails, but is seems like that could be a core issue.
burningserenity has joined #ruby
<siery> Hey, I have noticed some weird type exchange after enclosing my Proc inside the class.. So when I have assigned the proc to a variable, everything was fine:
<siery> app = Proc.new { ['200', {'Content-Type' => 'text/html; charset=utf-8'}, ["Hello, World!", "<script>console.log('Hello, World.')</script>"]] }
noboruma has joined #ruby
<Intelo> leitz, maybe permission issue? there was a sudo vs non-sudo bundle/gem issue lately
<Intelo> leitz, I have chmod 777 to all then
<leitz> Intelo, could well be. The page says not to install as root.
<leitz> Intelo, uh, 777 is a very bad idea. See if the install works, but you're going to need to restore from backup and start over.
<siery> So notice there is an key-value pair vector as the second entry.. when calling this within a class, like this:
<siery> def forge_app response_code
<siery> Proc.new do
<siery> [response_code.to_s, {'Content-Type' => 'text/html; charset=utf-8'}, [@content, "<script>console.log('Hello, World.')</script>"]]
<siery> end
<siery> endy
<Intelo> leitz, if I do not use sudo, it says Following files may not be writable, so sudo is needed:
<Intelo> /usr/local/bin
<Intelo> /var/lib/gems/2.5.0
<Intelo> and so on
<siery> The retun value is an array of strings..
<leitz> Intelo, maybe someone installed the original Redmine as root, and didn't use REDMINE_ROOT?
<Intelo> leitz, affirmative
<leitz> Intelo, or, you could add your group to whatever can write to those two directories, and "chmod g+w <dir>" them.
<Intelo> leitz, this tutorial was followed and I think it has all done via root https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<leitz> Intelo, I'd suggest planning on reinstalling redmine without root, though. It'll save you trouble next time.
<havenwood> siery: That looks like a Rack response, where that's the body, which must respond to #each.
<Intelo> leitz, please explain on the group / chmod thing. I know concept but not commands. Also redmine and all those stuff are packages. Need root for sudo apt install___. which part should I do without root?
<havenwood> siery: It's common for the body to be an Array of Strings—often with just a single String.
SeepingN has joined #ruby
<leitz> Intelo, do everything without root. If you need root, something's broken.
TomyWork has quit [Remote host closed the connection]
<leitz> Intelo, everything in Unix is a file; files, directories, pipes, whatever. Files have permissions: Read, Write, and Execute.
<havenwood> siery: Normally, the first element, the status, is represented by an Integer. You have a String, which will be coerced to an Integer but could just provide one directly.
TomyWork has joined #ruby
<havenwood> siery: [status, headers, body]
<havenwood> siery: [200, {'Content-Type' => 'text/plain'}, ['Hello, World!']]
TomyWork has quit [Remote host closed the connection]
<havenwood> siery: Usually, Integer, Hash, Array—but it's flexible so not always.
TomyWork has joined #ruby
TCZ has joined #ruby
<havenwood> siery: The body will chunk for each yield.
<leitz> Intelo, files also have a User they belong to, a Group they are labeled as. Everyone else is "Other". Each of those three has a permission set, Read, Write, Execute. If you look at files with "ls -l" you'll see stuff like:
<leitz> -rw-r--r--. 1 fred team 12345 Feb 26 15:36 my_cool_file.txt
<havenwood> Intelo: Depending on how Ruby is set up, gems may be installing to a local location in your user directory or to a system directory you don't own. The Redmine instructions appear to target a system location but a local one is generally favored for development especially.
<havenwood> Intelo: You can change where you Ruby installs gem or install a Ruby that's set up to install gems where you like.
<havenwood> Intelo: Whether you use sudo with a system location is up to you.
<leitz> The 777 means your files are -rwxrwxrwx The first rwx is the permissions the User has. The second is the Group's permissions, and the third is what everyone else (Other) can do.
<havenwood> Intelo: Bundler in particular complains if you do.
<leitz> havenwood, did you catch the URL Intelo sent? It probably makes more sense to you.
kristian_on_linu has joined #ruby
ellcs has joined #ruby
<havenwood> leitz: I haven't read the backlog yet. Will do!
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
<Intelo> leitz, havenwood the redmine is installed via sudo as a ununtu package. Its installed in a system location. So what should I do different than https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<havenwood> Intelo: It looks to me like these instructions would have you doing: sudo bundle exec
<havenwood> Intelo: Where is the non-sudo bundler installed?
<havenwood> Intelo: which -a bundler
<havenwood> which -a bundle
<havenwood> Intelo: gem which bundler
<Intelo> btw, now I have redmine issues as well. sending error log
<Intelo> havenwood, one sec
<leitz> havenwood, I'm considering bundler as an anti-pattern. :(
<siery> havenwood: yes, you are right, but now I shold get a key-value pair inside the `headers` variable
<havenwood> siery: You have a Hash: {'Content-Type' => 'text/html; charset=utf-8'}
<havenwood> &>> {'Content-Type' => 'text/html; charset=utf-8'}.class
<rubydoc> # => Hash (https://carc.in/#/r/8rkj)
<havenwood> siery: It looks fine to me.
<siery> havenwood: In stead there is only a string when I try to call status, headers, body = App.forge_app(port).call
<Intelo> havenwood, leitz I see some helper file missing too in apache error logs
wildtrees has joined #ruby
<havenwood> siery: The code you've shown here works: https://gist.github.com/havenwood/bc31dfe1bc8d6a46b49295506fe69578
bvdw has quit [Read error: Connection reset by peer]
<havenwood> siery: Only `status` is a String. (It should be an Integer, but Rack will call #to_i so it works.)
bvdw has joined #ruby
<havenwood> siery: forge_app(200).call.map(&:class) #=> [String, Hash, Array]
<havenwood> Intelo: What was your `which -i bundle` and `gem which bundler`?
<Intelo> Illegal option -i
<Intelo> Usage: /usr/bin/which [-a] args
<Intelo> for later /usr/share/rubygems-integration/all/gems/bundler-1.17.3/lib/bundler.rb
<havenwood> Intelo: -a I mean, sorry
<havenwood> Intelo: which -a bundler
<havenwood> Intelo: sudo gem which bundler
<Intelo> its already in paste I meantioned https://paste.ubuntu.com/p/NGjpmX25jT/
<havenwood> Intelo: head -n1 "$(which bundler)"
<Intelo> I removed a plugin and helper issue is gone. Others remain
<Intelo> havenwood, updated paste
<siery> havenwood: Ok, so I had some weird coversion somewhere else in the code as I am rewriting this from an functional black-box approach to an OO app
cschneid_ has joined #ruby
<havenwood> Intelo: Are you doing this as a non-root user?
cschneid has quit [Ping timeout: 250 seconds]
<havenwood> Intelo: whoami
<Intelo> havenwood, the commands you wrote? Those are executed as ubuntu user
<havenwood> Intelo: Okay, cool.
<Intelo> whoami is ubuntu
<havenwood> Intelo: Do you have a Command class in your code at all?
<havenwood> TypeError: superclass mismatch for class Command
<havenwood> /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:2:in `<class:Thor>'
<havenwood> Intelo: It's trying to inherit from an anonymous Struct, but blowing up since Thor::Command already inherits from something.
<Intelo> havenwood, yes class Command < Struct.new(:name, :description, :long_description, :usage, :options, :ancestor_name)
<havenwood> Intelo: You have that in your code? Or you're just saying that's what the second line of command.rb is?
<Intelo> yes
<Intelo> I have it in my code
<havenwood> Intelo: It seems to me that'd raise this error.
<Intelo> havenwood, ok. how to fix?
<havenwood> I'll show an example of what's happening.
roadie has quit [Remote host closed the connection]
<Intelo> ok. but thats not my code and I am not a ruby dev
roadie has joined #ruby
Tungki has joined #ruby
<havenwood> Intelo: "yes" "I have it in my code"
<Intelo> In my server, ^
<Intelo> havenwood, this is not my gem /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb
<Intelo> not created by me
<Intelo> node coded by me i mean
<havenwood> Intelo: So you're just trying to deploy an unmodified redmine? Okay.
<Intelo> correct
<Intelo> And I am facing these errors while installing a plugin called easy_gantt
<havenwood> Intelo: It seems the Thor::Command is getting loaded twice. I don't know why. By inheriting from an anonymous Struct they make it so you can't load this file twice. How that's happening, I can't see. I'm just drinking my first coffee but maybe that'll clear my mind's eye.
Arkantos has joined #ruby
<havenwood> Show the easy gantt error?
<Intelo> none other than this
<Intelo> when I click easy gantt. The apache log spits same error
<havenwood> Intelo: About Thor?
ExoUNX has quit [Ping timeout: 240 seconds]
<Intelo> havenwood, line 273 to be exact https://paste.ubuntu.com/p/cGmF9zTp23/
<havenwood> Intelo: It just trails off and hangs with?: App 1501 stdout:
<Intelo> When I click plugin on web page, it says error message page. error message stated at line 1 https://paste.ubuntu.com/p/Gfb5ftPCDn/
<xco> i have solved this, but i don't like how i did it, is will there be a more elegant solution? https://gist.github.com/xcobar/22164664b1255aed43e134758449577d
<havenwood> Intelo: It seems things are getting initialized twice, hence all the "already initialized" warnings. The Thor::Command class can't be initialized twice, due to the anon Struct inheritance. I don't know what's causing it to load twice, but that's why it can't load twice.
<Intelo> havenwood, ok. Can I uninstall ruby, gem etc? install again with non sudo? node that redmine installation dir is in system directories via redmine ubuntu package
<havenwood> xco: One way: reduce(Hash.new(0)) { |acc, h| acc.merge(h) { |_key, left, right| left + right } }
<havenwood> #=> {:cars=>5, :houses=>7}
<xco> what are you calling reduce on? havenwood
<havenwood> xco: The Array.
<xco> havenwood got it
<xco> havenwood got another way?
<Intelo> havenwood, leitz ?
<havenwood> &>> {:cars=>4, :houses=>5}.merge({:cars=>1, :houses=>2}) { |_, left, right| left + right }
<rubydoc> # => {:cars=>5, :houses=>7} (https://carc.in/#/r/8rky)
<havenwood> xco: first, *rest = array; first.merge(*rest) { |_, left, right| left + right }
<havenwood> xco: There are many ways, but merging makes sense.
<havenwood> xco: Avoid defining methods on core classes. If you do, use a refinement.
<xco> havenwood ok i see what's happening, doing some recursion in the third way?
<Intelo> havenwood, first I should remove ruby?
<havenwood> xco: That last example has no recursion, it's just pulling the first out of the array and then merging it with the rest.
sergioro has joined #ruby
<havenwood> Intelo: You don't need to remove an old Ruby to install a new one.
<xco> havenwood 🙏
<Intelo> should I reinstall remdine?
<havenwood> xco: I didn't know if the Array might have more than two, so made it work for as many as there are.
<Intelo> havenwood, how will redmine take new ruby and not old
<havenwood> xco: I didn't make it work for just one.
<xco> havenwood yeah i noticed
<havenwood> Intelo: Personally, I'd start on a fresh box and follow latest instructions. I've never installed Redmine, but it's just a Rails app, right?
<Intelo> yes
cthu| has joined #ruby
<Intelo> so what to do different this time?
<Intelo> do I need ruby-dev?
<Intelo> its an ubuntu package
<havenwood> Intelo: What is this for? Development or production?
<Intelo> prod
<Intelo> This is what I followed initially
<havenwood> Intelo: Seems there are multiple wikis: https://redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu
<havenwood> Intelo: Maybe someone who has ever installed Redmine will have a suggestion. I might even just use the official docker image and not worry about configuring a system.
<havenwood> Intelo: Alternatively, just set up a box for Rails, like Ryan Bigg's instructions I linked above, and install it like any other Rails app.
<Intelo> havenwood, understood. Question: Is having redmine installed in system directories where root is needed (have to do or cause any problems with gems/bundle/ruby etc? 0
<Intelo> leitz,
GodFather_ has joined #ruby
<Intelo> mentioning you as you know the old issues as well
GodFather_ has quit [Remote host closed the connection]
<havenwood> Intelo: A docker setup should already be configured. You can use sudo or not. There are many ways to set up a system.
<Intelo> If I follow this, the only think I need to change is not SUDO gem/bundle? https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<havenwood> Intelo: Use an up-to-date and supported distro.
<Intelo> my ubuntu is latest
<Intelo> updated
<Intelo> rephrase: If I follow this, the only think I need to change is to use latest ruby and not the default system installed on, and not SUDO gem/bundle? https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<havenwood> Intelo: Like I said, I'd consider just using the docker container if setup gave me pain. That said, you can follow the tutorial I linked above and just install this like any other rails app.
<havenwood> Intelo: I haven't read the Redmine instructions you linked because I saw Apache config and noped out.
schne1der has quit [Ping timeout: 265 seconds]
<havenwood> Intelo: It seems they have *many* wiki instructions, some not so great.
<Intelo> ok but I would want to go with the link I mentioned
<havenwood> Intelo: Can you just pair those ^ main instructions with Ryan Bigg's Rails setup above? Or does the already working docker work for you?
<havenwood> Intelo: The link you followed that resulted in this error?
<havenwood> Hrm.
<Intelo> I have tried many before and the link I mentioned worked for me only
<Intelo> havenwood, ^
<havenwood> Intelo: Okay, fine. I'll glance at the instructions you're following. They start with telling you which versions to use: https://www.ubuntuupdates.org/pm/redmine
<havenwood> Intelo: Which Ubuntu are you using? eoan?
<Intelo> yes 4.0
<Intelo> ubuntu 19
<Intelo> redmine 4
<xco> havenwood what happens if one of the keys is a string then? like this https://gist.github.com/xcobar/22164664b1255aed43e134758449577d ? i'm assuming you'd employ #values_at somewhere?
<havenwood> xco: 19.10
<Intelo> buntu 19.10 havenwood
<havenwood> kk
<Intelo> Redmine version 4.0.4.stable
<havenwood> xco: But I like "pilotcook" so maybe just leave it. :P
<xco> ha! :D
<Intelo> rephrase: If I follow this, the only think I need to change is to use latest ruby and not the default system installed on, and not SUDO gem/bundle? https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<xco> havenwood ok leave it i'll make it so you can add it
<xco> havenwood one sec
<Intelo> I think I will need sudo gem/bundle as redmine would be in system dirs?
<havenwood> xco: Do you want to exclude by key or by value class?
<xco> exclude by key
<havenwood> xco: first, *rest = array; first.merge(*rest) { |key, left, right| left + right unless key == :job }.compact
<Intelo> havenwood, should I just do sudo gem install?
<havenwood> xco: So you're using Redmine 4.0.4-1?
<Intelo> again i mean
<havenwood> Intelo: What version of Redmine?
<Intelo> Redmine version 4.0.4.stable
<Intelo> ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
<Intelo> Rails 5.2.4.2
<havenwood> Intelo: And you did a?: gem install bundler
<Intelo> ./usr/bin/ruby
<Intelo> havenwood, with sudo, yes
<havenwood> RAILS_ENV=production bundle exec rails -v
<Intelo> ./usr/local/bin/bundler
<Intelo> Rails 5.2.4.2
<Intelo> $ RAILS_ENV=production bundle exec rails -v
<havenwood> Intelo: Can you Intelo `cd` into the dir with the Gemfile and run?: bundle
<Intelo> so on..
<Intelo> $ RAILS_ENV=production bundle exec rails -v
<havenwood> Intelo: I've got to run, but will be back later.
<Intelo> ./usr/lib/x86_64-linux-gnu/ruby/2.5.0/etc.so: warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
<Intelo> so on..
<Intelo> havenwood, so problem with ruby
<havenwood> Intelo: Did you?: sudo apt-get install ruby-full
<Intelo> no
<Intelo> should i?
<havenwood> Intelo: Yes
<Intelo> I did ruby-dev though
<havenwood> Intelo: That suffices.
<Intelo> I did full too
<Intelo> so the problem is in ruby or rails?
<havenwood> xco: Did you exclude both those keys?
<xco> yup
<xco> i did and || on it
<havenwood> xco: Then should work.
<havenwood> xco: That doesn't work.
<havenwood> xco: Show what you did?
<xco> sec have to do write it again
<havenwood> xco: You'll probably want to: %i[job fat].include?(key)
<havenwood> Intelo: Looks like you have a borked Ruby install. Hard to see why if you started on a fresh box and ran: sudo apt-get install ruby-dev
<havenwood> Intelo: I don't have time or I'd just install it real quick.
<havenwood> Intelo: I could probably do that later.
* Intelo thinks to gem update fileutils --default
<havenwood> Intelo: I'd suggest just get Rails working as a first step.
<Intelo> havenwood, ok. When do you plan to return? I will do that then
<Intelo> havenwood, I guess i can reinstall ruby+rails. right?
<havenwood> Intelo: In the meanwhile, spin up a new box and follow the Ryan Bigg tutorial I linked above. You'll probably just get it working.
<xco> havenwood this is what i did
<Intelo> havenwood, so I should remove /and how to remove the already installed ruby?
code_zombie has joined #ruby
<havenwood> xco: But... that works.
<havenwood> xco: #=> {:cars=>12, :houses=>15}
<havenwood> xco: I think your || logic didn't work.
<havenwood> xco: I'm assuming you did: key == :job || :fat
<Intelo> havenwood, I should remove ruby first
<Intelo> How to?
<havenwood> Intelo: I said "fresh box" but you can not remove Ruby if you want.
<havenwood> xco: An || like that is always truthy.
<Intelo> I want to fix it
<Intelo> havenwood, the current box
<Intelo> I can restore later. I have backup
<xco> havenwood this is what i have
<xco> first, *rest = array;
<havenwood> Intelo: Follow the tutorial and get Rails going.
<xco> first.merge(*rest) { |key, left, right| left + right unless %i[job fat].include?(key) }.compact
meinside has quit [Quit: Connection closed for inactivity]
<havenwood> xco: That works.
<havenwood> => {:cars=>12, :houses=>15}
Tungki has quit [Ping timeout: 252 seconds]
<Intelo> havenwood, sure but how to remove ruby first?
<xco> havenwood it doesn't work on my machine
<xco> hahhah that was funny
<xco> but seriously it doesn't work
<havenwood> xco: Haha, it should.
<xco> maybe you missed something
<xco> i'll paste a screeenshot
<havenwood> xco: I don't think so, but only just finished first cup of coffee.
<havenwood> xco: Look at the return value of this line: https://gist.github.com/xcobar/22164664b1255aed43e134758449577d#file-sum-rb-L27
<havenwood> xco: => {:cars=>12, :houses=>15}
<havenwood> xco: Is that not what you want?
<xco> that's what i want
<Intelo> havenwood, I am doing
<Intelo> sudo apt-get purge ruby
<xco> havenwood look i'm not crazy https://gyazo.com/9331262ee720cad05d080ba1e1db7fcc
<havenwood> xco: You're printing the array you started with.
<havenwood> xco: You just aren't printing the result, which is correct.
<xco> god i'm such an idiot
<havenwood> xco: Print line 26 instead.
<xco> i completely forgot about that
<havenwood> xco: Heh, we all do this.
<xco> 🤣
<xco> sorry i'm lying upside down
<xco> :D :D
<xco> does that even make sense
<xco> no it doesnt
<havenwood> Intelo: Starting on a fresh box is often less frustrating and more reproducible. If you decide to take your baggage along with you and use this same box, you don't have to uninstall Ruby.
<Intelo> hm
<havenwood> Or they have an official docker container that's already working.
<havenwood> If you want another problem. :P
<Intelo> havenwood, well ubuntu has ruby already. If I do install ruby-dev AND what ryan's tutorial, i will have 2 rubys. Which one will redmine use?
<xco> havenwood we're good now thanks :)
<Intelo> havenwood, also, do I need chruby
Lewix has joined #ruby
ChmEarl has joined #ruby
cyberarm has quit [Ping timeout: 240 seconds]
alfiemax has quit [Remote host closed the connection]
<havenwood> Intelo: There are many ways to do it. You can have many Rubies installed. It doesn't matter if you configure the one you're using properly. You can set PATH, GEM_HOME, etc yourself, and that's what I'd do, but chruby will do it for you.
<havenwood> xco: Woot!
<xco> havenwood :)
<havenwood> Intelo: Just get Rails working via Ruby first. If you can `rails new intelo && cd intelo && rails c` and Rails runs, that's a good sign.
<havenwood> Intelo: Does that ^ work on your current setup?
TCZ has quit [Quit: Leaving]
<havenwood> Intelo: #rubyonrails channel would probably be happy to help get Rails running.
alfiemax has joined #ruby
<apotheon> "I have a problem. Oh, I know, I'll use Docker! Now I have eight problems."
<apotheon> This requires problem orchestration.
<havenwood> apotheon: Time for K8s.
<apotheon> Yay!
<adam12> Ops in general is kinda jank. I'm deep into my third day of package conflict nightmares and Ansible idiosyncrasies. It's much nicer on the software side IMHO :)
<Intelo> havenwood, no same error
<Intelo> havenwood, but I did this following. Let me know how can I use that instead >>> Successfully installed ruby 2.6.5 into /home/ubuntu/.rubies/ruby-2.6.5
<havenwood> Intelo: Did you also install chruby?
<Intelo> havenwood, no
<Intelo> havenwood, do i need to?
<apotheon> sysadmin is bailing water
<havenwood> Intelo: It's one way.
<apotheon> I hate that crap.
<apotheon> That's why I got into software dev.
<havenwood> Intelo: You could alternatively add your Ruby bin/ and Gem bin/ dirs to PATH and set GEM_HOME and GEM_PATH.
<Intelo> havenwood, and where to install rails?
<havenwood> Intelo: Once you've setup the newly installed Ruby env vars, with chruby or by yourself, you can `chruby 2.6` and then `gem install rails`.
<havenwood> Intelo: gem install rails
<apotheon> I should do two things:
<apotheon> 1. get in the habit of calling it "software engineering" so people are more willing to give me money, because for some reason that matters
<phaul> adam12: could you try something for me? Could you try "!fact add a b" then if worked "!fact rm a" with ruby[bot] I would like tosee if it's just me that the bot is ignoring..
<apotheon> 2. shut up so havenwood can help Intelo in peace
<havenwood> !fact add a b
<ruby[bot]> havenwood: I will remember that a is b
<havenwood> !fact rm a
<ruby[bot]> havenwood: I forgot what a is.
<havenwood> ?a
<ruby[bot]> havenwood: I don't know anything about a
<phaul> !fact add a b
<Intelo> havenwood, ok, how can I change path?
<havenwood> !fact rm b
<ruby[bot]> havenwood: I never knew what b is.
<Intelo> $PATH
<havenwood> Intelo: The fact you don't know suggests you should either leave deployment to others or learn some shell.
<phaul> yeah adam12 could you try it too please... I have a suspicion that there is something amiss in the bot..
<havenwood> Intelo: PATH is a standard shell environment variable.
<leitz> !fact add a b
<leitz> ?a
<ruby[bot]> leitz: I don't know anything about a
schne1der has joined #ruby
<Intelo> havenwood, I know. just keeping assurity I do not clash with anyruby thing
<leitz> ?a
<ruby[bot]> leitz: I don't know anything about a
<leitz> ?b
<havenwood> Intelo: export PATH="/path/to/ruby/bin:/path/to/gem/bin:$PATH"
<havenwood> Intelo: chruby will do this for you
<Intelo> Iam just nano etc/environment
<havenwood> nano \o/
<Intelo> export PATH is permanent?
<havenwood> Intelo: For the current process.
<leitz> Intelo, yes. It lets other things use PATH.
<Intelo> need systemwide permanaent
<havenwood> Intelo: You'd need to put it in a dotfile or otherwise change your PATH.
fercell has quit [Quit: WeeChat 2.7.1]
<Intelo> Iam just nano etc/environment
<leitz> Intelo, here's part of my ~/.bash_profile file, it sets the path.
<leitz> PATH=${HOME}/perl5/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$HOME/bin:${HOME}/lang/go/bin
<leitz> export PATH
<havenwood> Intelo: If you're not familiar with what these should be, you could check what chruby sets them to.
<Intelo> $ cat /etc/environment
<Intelo> PATH="/home/ubuntu/.rubies/ruby-2.6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
<havenwood> Intelo: Then set at least GEM_HOME and GEM_PATH.
<apotheon> Exporting PATH is "permanent" for the current process and all child processes. If the "current process" where it gets exported is your login shell for X, all shells within the X session will use the same PATH.
<Intelo> havenwood, to what?
<apotheon> AFK
<havenwood> Intelo: GEM_HOME is where gems install and GEM_PATH is where to look for gems to load.
<havenwood> Intelo: GEM_PATH is a single dir and GEM_PATH is a colon delimited list like PATH.
<havenwood> GEM_HOME is single, I mean.
<Intelo> have path should it be?
<havenwood> Intelo: You could look at what chruby sets them to then uninstall chruby if you want a cheat sheat.
<havenwood> sheet*
<Intelo> what*
<Intelo> what path should it be if I do it manually?
<Intelo> havenwood, ok
<havenwood> Intelo: It's honestly up to you. I'd suggest following chruby convention.
<Intelo> $ which ruby
<Intelo> .home/ubuntu/.rubies/ruby-2.6.5/bin/ruby
<Intelo> but redmine is taking old version
<havenwood> Intelo: Yup, so that bin/ dir needs to be in PATH.
<Intelo> how canI change that
<Intelo> havenwood, its in path now
<havenwood> Intelo: Okay, next set GEM_HOME.
<Intelo> how can I ask redmine not to use the old ruby
<Intelo> havenwood, GEM_HOME to which path?
<havenwood> Intelo: And then add your gem bin/ dir to PATH too.
<havenwood> Intelo: The easiest way is to quickly install chruby, then check your PATH, RUBY_ROOT, GEM_HOME, GEM_PATH, etc and set them all how chruby did.
<havenwood> Intelo: Or you can read docs to understand these and set them appropriately.
<Intelo> thinking to just delete ruby
<havenwood> Intelo: I have dozens of Rubies installed and none conflict.
<havenwood> Intelo: Just set these few env vars... or let chruby do it for you like most folk do.
<havenwood> Intelo: You can literally copy how chruby sets them and uninstall chruby. I'm not currently in the mood to walk through each one, but maybe someone else here is!
<Intelo> great; sudo apt-get install apache2 libapache2-mod-passenger installs ruby 2.5 back again. Now what I do?
<havenwood> Haha
<havenwood> Intelo: You're just a few env vars away from Rails working with Ruby 2.6.5. It's up to you!
<havenwood> Intelo: I personally read various manpages and docs then wrote the chruby manpage to explain what these env vars do. You can set them yourself or use a tool to do it. Just adding Ruby and Gem bin/ dirs to PATH and setting GEM_HOME and GEM_PATH should be plenty.
<havenwood> Intelo: If you prefer to work with a somehow broken system install of Ruby, an Ubuntu expert might be willing to help you debug the package Ruby error you're seeing.
<Intelo> $ bundle update --bundler
<Intelo> You must use Bundler 2 or greater with this lockfile.
<havenwood> Intelo: gem install bundler
<Intelo> ok
<Intelo> havenwood, this is my last try. If it fails. I will install fresh ubuntu
<havenwood> Intelo: A fresh system where you're very aware of every command that's been run is lovely.
<Intelo> havenwood, super. That is plan b
<havenwood> Intelo: You could quickly get Ruby and Rails working the proceed.
<havenwood> then**
<Intelo> for now surprisingly gem install/bundle install is working without sudo
<havenwood> my "nnnn" key is broke. either may or nnnone.
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
cliluw has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
KeyJoo has joined #ruby
KeyJoo has quit [Max SendQ exceeded]
alfiemax has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 256 seconds]
rippa has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
Sauvin has quit [Read error: Connection reset by peer]
<Intelo> havenwood, I have fresh ubuntu 19 now. How to make sure I use the latest ruby and not the one that "is going to be" installed with passanger
<havenwood> Intelo: Installing passenger doesn't typically install a Ruby in particular, libapache2-mod-passenger for example.
<Intelo> havenwood, When I install libapache2-mod-passenger and apache, it installs ruby
<havenwood> Intelo: Here, for example, Passenger show how to install with RVM. You can do the same with chruby, rbenv, or a Ruby you compile and set up yourself with env vars. https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/apache/oss/install_language_runtime.html
<havenwood> Intelo: Just ignore your package manager Ruby if you want to follow instructions like Passenger shows. libapache2-mod-passenger
<Intelo> havenwood, but the thing is, do I need new ruby version? Why not live with what is installed already?
<havenwood> Intelo: The Passenger folk outline some of those reasons in the Fullstaq Ruby FAQ: https://fullstaqruby.org/
<Intelo> havenwood, I mean now that the system is fresh and nothing is broken
<havenwood> Intelo: You could use the Fullstaq Ruby if you wanted: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/blob/master/README.md
<Intelo> yes but
<havenwood> Intelo: Ah, nice. So I'd suggest first picking a way to install Ruby then install Rails and get it working.
<havenwood> Intelo: Is there a specific way you're set on installing Ruby or would you like suggestions?
<Intelo> havenwood, ok what to change/ take care of this time while following this guide https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step
<Intelo> havenwood, no just this guide
<havenwood> Intelo: That seems like a very specific way. You could install Ruby differently and adapt the guide. Did you follow the guide exactly before?
<Intelo> yes
<Intelo> thats how I got redmien working initially
<havenwood> What broke it?
<Intelo> the errors I showed after trying to install plugin
<havenwood> What is plugin?
<havenwood> I don't know Redmine.
<Intelo> easy_gantt
<Intelo> but thats not the Issue I think. sudo vs none sudo was
<Intelo> I think
<Intelo> So how can I solve that as my redmine is in system dir. I need sudo there but its not good practice to use sudo with gem and bundle
<havenwood> Intelo: Then follow the Passenger instructions or something equivalent.
<havenwood> Intelo: "There are other ways to install Ruby, e.g. through yum, apt-get, source tarball, rbenv and chruby. You can use one of those other installation methods if you so wish, and this tutorial will work fine even if you installed Ruby using one of those other installation methods."
<havenwood> Intelo: Passenger knows how to install Passenger. Once you
<havenwood> have it working, i'd imagine Redmine should just work.
<havenwood> Intelo: You could follow the Passenger guide but use chruby then hardcode the chruby env vars and uninstall it.
<havenwood> Intelo: Or follow the guide exactly, or any of the other ways they suggest.
<Intelo> ok
<Intelo> but how can I solve that as my redmine is in system dir. I need sudo there but its not good practice to use sudo with gem and bundle
<Intelo> havenwood, ^
<havenwood> Intelo: The Passenger installation instructions will install Ruby and RubyGems in a local directory. So would the Ryan Bigg tutorial I referred you to that has the equivalent for chruby, that you could combine with the Passenger guide.
vondruch has quit [Ping timeout: 246 seconds]
<havenwood> Intelo: Passenger has great docs and is probably the best reference for installing Passenger.
<Intelo> going to uninstall ruby first
<havenwood> ¯\_(ツ)_/¯
<havenwood> Many times there are multiple Rubies. A system may use system Ruby for other things. If you properly configure your app's Ruby, it just doesn't matter what other Rubies are installed any more than it matters that other languages are installed.
<havenwood> That said, starting fresh and following Passenger docs should work.
<havenwood> As would just following Passenger docs from where you are.
<havenwood> Apache and Passenger is just one of many, many ways to deploy a Rails app, FWIW.
<havenwood> Even with Passenger, the Apache integration is optional.
<Intelo> hm
<havenwood> Nginx or Apache with Passenger is certainly a fine setup. The Rails default is Puma.
cd has joined #ruby
<havenwood> Passenger is nicely done and has an enterprise support option. I see Puma or Unicorn more often in the wild.
TomyWork has quit [Remote host closed the connection]
<Intelo> hm
<havenwood> The Apache and NGINX integration is unique for Passenger. Other Rack webservers just work via reverse proxy from NGINX or Apache.
BTRE has quit [Remote host closed the connection]
<havenwood> Or they serve directly on port 443, and don't use Apache or NGINX at all.
<Intelo> I had very hard times doing this without the redmine guide. Thats why I was hesitating to change anything.
<havenwood> Intelo: It should only take minutes to install Ruby via the Ryan Bigg guide and run Rails. Have you tried?
<havenwood> Intelo: AFAIK, Redmine is a Rails app. Am I missing something?
<Intelo> I already have installed. its compinling
<havenwood> I don't know Redmine so maybe I'm missing something.
<Intelo> its just another rails ap
tpanarch1st has joined #ruby
buckworst has joined #ruby
<Intelo> havenwood, even if I install new ruby, I have to do sudo gem/bundle as redmine will be in system dir
<Intelo> havenwood, what to do in that scenario?
wildtrees has quit [Remote host closed the connection]
<Intelo> also this says ruby will be installed (just letting you know for info) https://paste.ubuntu.com/p/gcvdsHKzvx/
wildtrees has joined #ruby
<havenwood> Intelo: Some folk use --deployment flag with bundler to lock the Bundle and install gems in a local directory to the Rails app root. If you don't do that, Bundler will install gems in GEM_HOME, so it's irrelevant where your Rails app is.
<havenwood> Intelo: Can't you move Redmine wherever you like?
<Intelo> no ^
<Intelo> how can I add GEM_HOME to path and make its place like /home/ubuntu/gem_hom ?
<havenwood> Intelo: GEM_HOME is itself an env var.
<Intelo> Iam just doing export GEM_HOME=$HOME/.gem
<Intelo> export GEM_PATH=$HOME/.gem
<Intelo> cool?
<havenwood> Intelo: Do: chruby 2.6
<Intelo> ok.
<havenwood> Intelo: Then: printenv GEM_PATH
<Intelo> wget -O chruby-0.3.9.tar.gz \
<havenwood> Intelo: Redmine is just a Rails app. Clone it locally.
<Intelo> havenwood, oh if I do it, its hell of configs
<havenwood> Intelo: If you followed the Ryan Bigg tutorial steps, just stop.
<havenwood> Intelo: From your terminal, type: chruby 2.6
<Intelo> tar -xzvf chruby-0.3.9.tar.gz
<Intelo> sory
<havenwood> Intelo: Let us know when you have followed the steps in that Ryan Bigg tutorial?
<Intelo> $ chruby
<Intelo> ruby-2.6.5
<Intelo> yes
<Intelo> havenwood, all set
<Intelo> now what?
<havenwood> Intelo: From your ubuntu user directory: git clone --depth 1 https://github.com/redmine/redmine.git
<havenwood> Intelo: cd redmine
<Intelo> seriously? We both will be stuck but I can go ahead if you say so
<havenwood> Intelo: To get to your user home, just: cd
<havenwood> Intelo: We will both be stuck?
<Intelo> ya.
<havenwood> Intelo: I don't understand?
<Intelo> in apache, phussion passengar, mysql configuration
<Intelo> havenwood, what you say, should I continue?
<havenwood> Intelo: That tutorial didn't work for you. I'm just showing you how to get Ruby working. How to then run the redmine app locally. Then you can setup a DB and decide how you'd like to serve it up. I don't personally care how you deploy this, but it takes only a few minutes to get Rails running if you follow one of *many* up-to-date tutorial.
<Intelo> ok
<Intelo> one issue: $ $GEM_PATH
<Intelo> bash: /home/ubuntu/.gem/ruby/2.6.5:/home/ubuntu/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0: No such file or directory
<Intelo> ubuntu@ip-172-31-23-113:~/ruby-install-0.7.0/chruby-0.3.9$ $GEM_HOME
<Intelo> bash: /home/ubuntu/.gem/ruby/2.6.5: No such file or directory
<havenwood> Intelo: Maybe I'm not the best person to help here, since I don't like configuring Apache and have never used Redmine. It looks like a plain old Rails app to me and THEY even suggest just cloning it and running it.
<havenwood> Intelo: printenv GEMPATH
<havenwood> Intelo: You can't just run env vars. :P
<Intelo> nothing on printenv GEMPATH
<havenwood> I mean, you can - it just typically doesn't work.
<havenwood> Intelo: GEM_PATH
<havenwood> My keyboard sucks.
<Intelo> $ GEM_PATH
<Intelo> GEM_PATH: command not found
<havenwood> Intelo: >.>
<havenwood> Intelo: printenv GEM_PATH
<havenwood> Intelo: Read a tutorial about shell environment variables.
<Intelo> ./home/ubuntu/.gem/ruby/2.6.5:/home/ubuntu/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
<havenwood> Intelo: That is unremarkable, and correct.
<Intelo> ok
<Intelo> cloning redmine
<Intelo> havenwood, done
<havenwood> Intelo: cd redmine
<Intelo> done
<havenwood> Intelo: bundle
<Intelo> Please configure your config/database.yml first
<havenwood> Intelo: Cool, pick a DB. I'd suggest Postgres.
<havenwood> Intelo: (See the Ryan Bigg tutorial.)
<Intelo> my old backups are in msyql
<Intelo> going for it
<Intelo> bundle === bundle install?
<havenwood> Intelo: Yes.
<havenwood> Intelo: I'd not use threequals for that though. :P
<havenwood> I'm not a case statement!!
Fusl has quit [Max SendQ exceeded]
alfiemax has joined #ruby
Fusl has joined #ruby
<adam12> havenwood === Person
<adam12> # => nil
* havenwood nods
<adam12> WAT
<havenwood> :O
<havenwood> I aspire to personhood.
<adam12> Reminds me of the nil.nil? # => nil I saw a few days ago in here. Lulz.
<havenwood> &>> nil.nil?.nil?
<rubydoc> # => false (https://carc.in/#/r/8rmc)
<havenwood> &>> nil&.nil?.nil?
<rubydoc> # => true (https://carc.in/#/r/8rmd)
<havenwood> &>> nil&.nil?&.nil?
<rubydoc> # => nil (https://carc.in/#/r/8rme)
<Intelo> lol
<Intelo> havenwood, done :)
<Intelo> whats next
<havenwood> Intelo: rails s
<Intelo> hm..
<Intelo> Listening on tcp://127.0.0.1:3000
alfiemax has quit [Ping timeout: 250 seconds]
<Intelo> havenwood, but I do not see any page in browser on :3000
<Intelo> havenwood, nmap says 3000/tcp closed ppp
<Intelo> hm rails server --binding 0.0.0.0 --port 3000
kinduff has quit [Read error: Connection reset by peer]
<havenwood> Intelo: Your options are now port 80, 443, or keep serving on 3000 or a socket and reverse proxy to it from NGINX or Apache.
kinduff has joined #ruby
<havenwood> Intelo: Assuming you'll want an SSL cert here?
<havenwood> Intelo: Unsecured, for example: rails s --binding 0.0.0.0:80
<havenwood> (I think that syntax works with `rails`, can't remember. You could do port separately.)
<havenwood> Intelo: https://letsencrypt.org/
ferche23 has joined #ruby
wildtrees has quit [Remote host closed the connection]
wildtrees has joined #ruby
cschneid has quit [Ping timeout: 256 seconds]
cschneid_ has joined #ruby
wildtrees has quit [Max SendQ exceeded]
dylanf has joined #ruby
renich has joined #ruby
<dylanf> Hi all :)
<adam12> dylanf: heyo
ChmEarl has quit [Quit: Leaving]
jmcgnh has quit [Ping timeout: 256 seconds]
<dylanf> I'm trying to DRY up a factory by somewhat parameterizing the traits. Thing is, I don't know if I can actually do this the way I'm writing it: https://gist.github.com/arubis/e26dc1ba6e2df602384961708f224ce4
<Intelo> havenwood, how to run database creation?
<dylanf> Can I write transient attributes into a trait, then have another trait mix in that first trait's behavior, overwriting the transient attributes?
<dylanf> Or am I overcomplicating things in the name of DRY code, and should instead just leave these traits defined literally?
jmcgnh has joined #ruby
<havenwood> Intelo: Look through the `rails -T` options.
<Intelo> havenwood, redmine is up!
<havenwood> Intelo: Congrats!
<Intelo> fu$king awsome
<Intelo> All I have to do now is change port 80, and make a system service to run it every time on boot
<havenwood> Intelo: Should be easy to configure systemd. Do you really not need HTTPS?
<Intelo> havenwood, systemd yes.
<Intelo> https is good via letsencrypt
<Intelo> but will do that later
<Intelo> havenwood, oh, dont daemonize?
<Intelo> well how to run it everytime then?
<havenwood> Intelo: No, let systemd handle it. You don't have to *yourself* create a daemon.
<havenwood> Intelo: Just leave it at proper systemd setup, that's perfect.
<Intelo> havenwood, how exactly do you mean to do it?
<havenwood> I just mean nothing else is required, like oldendays.
<havenwood> Like it was in oldendays.
ellcs has quit [Ping timeout: 260 seconds]
<Intelo> havenwood, like I do need a script in systemd/system right?
<havenwood> Intelo: Then you'll probably want to have a little puma config file. It's easy to look up how to do SSL or other config with Puma.
<Intelo> dont want puma
<havenwood> Intelo: I don't want to do more sysadmin today, but happy to help with any Ruby.
<Intelo> !thumbs up
<havenwood> Intelo: Unicorn, Puma, Passenger, etc should all have docs or examples with systemd.
drincruz has quit [Read error: Connection reset by peer]
drincruz has joined #ruby
vondruch has joined #ruby
<Intelo> havenwood, I don't think I even need them
<Intelo> to just run rails s
dionysus69 has joined #ruby
<havenwood> Intelo: The default for Rails is Puma. Redmine has that for test env but seems to be older than that convention.
GodFather has quit [Ping timeout: 256 seconds]
<havenwood> Intelo: If you don't specify Puma, Unicorn, or another it'll default to WEBRick, which you don't want.
Jonopoly has joined #ruby
<havenwood> Intelo: You can add `gem 'puma'` to the Gemfile to make it like the Rails default.
<havenwood> Intelo: Or your webserver of choice. WEBRick will work, but there's a reason Rails adopted a default.
hiroaki has joined #ruby
<Intelo> havenwood, ok, I have some real ruby errors now https://paste.ubuntu.com/p/qGW6N24Yxg/
<adam12> dylanf: I looked at your factory and I don't use Factorybot much, I'd say lean on the side of less is more. So less factories / traits. The question becoming, do you care if you're testing front_left or front_right tire pressure? Do they really make a difference?
<havenwood> Intelo: The error includes the solution.
<havenwood> Intelo: You're in Rails land now.
<Intelo> ok
<Intelo> was just sharing
<havenwood> Intelo: 👍🏽
<Intelo> $ rails credentials:edit
<Intelo> No $EDITOR to open file in. Assign one like this:
<havenwood> Intelo: sudo update-alternatives –config editor
<havenwood> --config
<Intelo> k
<havenwood> sudo update-alternatives --config editor
<havenwood> Intelo: Then export the env var for the one you pick.
ellcs has joined #ruby
<havenwood> Intelo: export EDITOR="/usr/bin/vim.tiny"
<dylanf> adam12: That's a good take-a-step-back piece of feedback; much appreciate it. :+1: Unfortunately, in this case, I think the answer is that I do care--the dependent tests want to see the right messaging out of the eventually-resulting API call.
* Intelo uses nano
<dylanf> FactoryBot's documentation always has me feeling like I'm right on the edge of expertise because I frequently overshoot its actual, well, documentation. :/
<adam12> dylanf: I'm not sure there's a right or wrong answer here. No reason you couldn't use a little meta programming to DRY this up.. but if you only need 2 traits then I might not bother. And with that said, do you need a trait for this if you're only testing it in one spot? Maybe you could get by with a build_stubbed and then set/mock the field you care about. I'm not sure.
<dylanf> adam12: I think that's closer to the feedback I'll give my colleagues -- maybe just build `:tire_pressure` along with the transient attributes, and actually include the attributes in the call to `FactoryBot.build`.
ur5us has joined #ruby
<adam12> dylanf: I think a lot of people get carried away with transients and factories, which can be a culprit in slow tests.
<baweaver> That and database cleaner
<baweaver> A lot of the trick to getting around it is to have code which doesn't involve database interaction whenever possible
<baweaver> Database interaction should be the last point of integration, an update of state, kept to the edge of an application
<baweaver> If it's intermingled you have to contend with multiple updates and other concerns
GodFather has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dylanf> adam12: Definitely makes sense. In this case I have only limited purview in terms of totally reshaping these--think I'd rather suggest just stripping down to "why are the tires any different, anyway?"--but that gives me a start :D
<adam12> dylanf: good luck :)
pupsikov has joined #ruby
rmnull has joined #ruby
<Intelo> havenwood, whats the best way to keep rails s running? I think redmine uses puma
<Intelo> as it said Booting Puma
<havenwood> Intelo: Systemd keeps it running. Puma is the default webserver for Rails. Just add `gem 'puma'` to the Gemfile and ru: budle
<havenwood> my nnnnnns
<Intelo> havenwood, should I do `gem install puma`?
jmcgnh has quit [Ping timeout: 250 seconds]
<havenwood> Intelo: Add it to your Gemfile and run: bundle
<Intelo> its already there under group :test do
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> Intelo: That's only for the test environment, unlike a standard Rails app created with: rails new
<Intelo> $ bundle
<Intelo> Your Gemfile lists the gem puma (>= 0) more than once.
<Intelo> You should probably keep only one of them.
<havenwood> Intelo: Remove it from test if you have it globally.
jmcgnh has joined #ruby
xco has joined #ruby
<Intelo> oh
NODE has quit [Quit: changing servers]
BTRE has joined #ruby
<Intelo> havenwood, do I need side kick?
NODE has joined #ruby
<Intelo> havenwood, wait, why can't I just put 'rails s' in the systemd?
<havenwood> Intelo: I'm happy to answer Ruby questions, but I'll leave this one to someone else.
<havenwood> BBIAB
<Intelo> ok
<Intelo> havenwood, rails s is ruby question. no?
<havenwood> Intelo: "How does 'rails s' work under the hood" is a Ruby question. Or "how would I write a command that parses options like 'rails s' in Ruby?" But how do I run `rails s` in systemd is much more of a sysadmin question. Which part of that question has any Ruby in it?
NODE has quit [Client Quit]
akem_ has joined #ruby
<havenwood> Intelo: If there's *any* Ruby code involved in the solution, that's a good sign it's a Ruby question.
NODE has joined #ruby
<havenwood> Intelo: I love helping with Ruby. There's only so much ops I'll do for free. :P
<havenwood> I like ops, but not by proxy.
akem has quit [Ping timeout: 240 seconds]
<Intelo> havenwood, oh :)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
ExoUNX has joined #ruby
<leitz> havenwood, this morning's work. I wanted to figure out Comparable, hands on. Too easy to just read about it. https://gist.github.com/LeamHall/0fed7eec853f6026bc512958bf0183b6
nullus has quit [Remote host closed the connection]
postmodern has joined #ruby
ExoUNX has quit [Ping timeout: 240 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
ellcs has quit [Ping timeout: 256 seconds]
jetchisel has joined #ruby
tpanarch1st has quit [Ping timeout: 256 seconds]
bvdw has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bvdw has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucasb has quit [Quit: Connection closed for inactivity]
tpanarch1st has joined #ruby
<Intelo> leitz, havenwood ruby error: https://paste.ubuntu.com/p/N6gpC579HS/
ferche23 has quit [Remote host closed the connection]
ferche23 has joined #ruby
banisterfiend has joined #ruby
ferche23 has quit [Max SendQ exceeded]
roadie has quit [Ping timeout: 256 seconds]
ferche23 has joined #ruby
<al2o3-cr> Intelo: wtf is /usr/bin -lc?
<al2o3-cr> /usr/bin is directory
tpanarch1st has quit [Ping timeout: 240 seconds]
ferche23 has quit [Max SendQ exceeded]
<Intelo> al2o3-cr, its commented out
<al2o3-cr> even so
<Intelo> thats why its commented. Good concern though
ferche23 has joined #ruby
ferche23 has quit [Max SendQ exceeded]
markopasha has quit [Remote host closed the connection]
buckworst has quit [Ping timeout: 256 seconds]
ferche23 has joined #ruby
ferche23 has quit [Max SendQ exceeded]
ferche23 has joined #ruby
roadie has joined #ruby
<Intelo> al2o3-cr, so whats wrong?
<al2o3-cr> what does `gem -v` say?
<al2o3-cr> Intelo: ^
ferche23 has quit [Remote host closed the connection]
ferche23 has joined #ruby
<al2o3-cr> Intelo: and probably paste your `gem env`
TCZ has joined #ruby
<Intelo> al2o3-cr, the app works fine in console.
roadie has quit [Ping timeout: 240 seconds]
ferche23 has quit [Max SendQ exceeded]
<Intelo> al2o3-cr, its not running in via systemd.
<al2o3-cr> Intelo: great!
<Intelo> maybe due to GEM_HOME or something else?
<Intelo> al2o3-cr, thats the problem; I mean
ferche23 has joined #ruby
<Intelo> al2o3-cr, so any env issue?
ferche23 has quit [Max SendQ exceeded]
<al2o3-cr> Intelo: have you asked in #systemd?
ferche23 has joined #ruby
ferche23 has quit [Max SendQ exceeded]
ferche23 has joined #ruby
ferche23 has quit [Max SendQ exceeded]
<Intelo> al2o3-cr, yes
<al2o3-cr> yes, what?
ferche23 has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
<havenwood> Intelo: You can use chruby-exec in ExecStart.
ferche23 has quit [Remote host closed the connection]
<havenwood> Intelo: For example: chruby-exec ruby-2.6 -- bundle exec rails server --binding 0.0.0.0
ferche23 has joined #ruby
<havenwood> Intelo: If you're going to hardcode to a Rails, use the one in rubymine/bin not the Rails gem one.
<havenwood> Intelo: The rubymine/bin/rails includes bundle setup for that particular app, unlike what you're doing.
<havenwood> Intelo: `chruby-exec` with `bundle exec` also works.
<havenwood> Intelo: Does that make sense?
<Intelo> hm.
<Intelo> i was doing this and sharing now. https://paste.ubuntu.com/p/4CGNG7c3zg/ with ExecStartPre=/usr/bin/env
<Intelo> looks working.. I think.
<Intelo> sane?
<havenwood> Intelo: Looks fine to me. It's on port 3000, so you'll want to change that or reverse proxy to that port.
G has quit [Ping timeout: 246 seconds]
schne1der has quit [Ping timeout: 250 seconds]
<al2o3-cr> is #rubyonrails still active?
<al2o3-cr> seems people asking questions for rails lately
<al2o3-cr> then why not merge #rubyonrails with #ruby?
<al2o3-cr> i suppose ask matthewd
wildtrees has joined #ruby
<apotheon> Was rhyming three out of four of those lines intentional?
wildtrees has quit [Max SendQ exceeded]
<al2o3-cr> apotheon: in which language?
wildtrees has joined #ruby
akem_ is now known as akem
roadie has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
aphprentice__ has joined #ruby
dylanf has quit [Ping timeout: 240 seconds]
johnny56 has joined #ruby
meinside has joined #ruby
agit0 has quit [Ping timeout: 272 seconds]
burningserenity has quit [Remote host closed the connection]
ferche23 has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 256 seconds]
ferche23 has joined #ruby
ferche23 has quit [Remote host closed the connection]
ferche23 has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferche23 has quit [Max SendQ exceeded]
roadie has joined #ruby
<apotheon> al2o3-cr: English.
<apotheon> "lately" "ruby" "math ewe dee"
<al2o3-cr> apotheon: behave man!
<apotheon> What?
Technodrome has joined #ruby
<al2o3-cr> ^ read the line above
drincruz has quit [Ping timeout: 256 seconds]
ChmEarl has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
markopasha has joined #ruby
<apotheon> al2o3-cr: I have no idea what you're saying.
<al2o3-cr> apotheon: i have no idea what you're saying too.
<apotheon> 22:03 < al2o3-cr> is #rubyonrails still active?
<apotheon> 22:06 < al2o3-cr> then why not merge #rubyonrails with #ruby?
<apotheon> 22:04 < al2o3-cr> seems people asking questions for rails lately
<apotheon> 22:07 < al2o3-cr> i suppose ask matthewd
<apotheon> Three out of four of those lines rhyme.
<apotheon> Only "active" doesn't rhyme with the others.
<apotheon> That's what I'm saying.
<al2o3-cr> not one of thos lines rhymes.
<al2o3-cr> *those
<apotheon> They all end in "ee" sounds.
<apotheon> How do *you* pronounce them?
<apotheon> "latelub", "rubgig", and "mathewjake"
<al2o3-cr> apotheon: obviously not like you do.
<apotheon> "late-lee", "rube-ee", and "mathewd-ee" (because it ends in the letter "D", pronounced "dee")
<apotheon> That's how rhyming works.
<al2o3-cr> apotheon: well, fuck me. i'd have never of guessed that.
TCZ has quit [Ping timeout: 240 seconds]
<apotheon> How do they not rhyme when they rhyme?
<apotheon> Explain how they don't rhyme, please.
TCZ has joined #ruby
<al2o3-cr> apotheon: look it up
<apotheon> What part of what I said about how they're pronounce is "wrong" to you?
<apotheon> s/pronounce/pronounced/
<apotheon> I shouldn't have a debate about rhyming with someone who thinks it's "never of" instead of "never have".
<apotheon> forget it
<al2o3-cr> apotheon: try #rappers
<al2o3-cr> lol
<xco> playing with thor, anyone know how i can get a list of defined commands?
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> apotheon: it's grammatically incorrect, and?
dionysus69 has quit [Quit: dionysus69]
<al2o3-cr> apotheon: Mr English.
<leftylink> huh. I used to be like that too!
wildtrees has quit [Quit: Leaving]
<leftylink> *used to*, I emphasise strongly to those who may be reading right now and making assumptions about my present state
markopasha has quit [Ping timeout: 240 seconds]
<phaul> no one has picked up on the too vs either :) (except me now, so even my sentence is incorrect)
<havenwood> xco: I think: thor list
<leftylink> "do not draw a conclusion too quickly / time is it's yet early" (movie scene with this subtitle: https://i.imgur.com/OetJaek.png )
<xco> havenwood in code :)
<leftylink> one of my more preferred lines
<havenwood> xco: It's something like #all_commands.
<havenwood> xco: Looks like the alias is #all_tasks.
<xco> class method
<xco> let me test it
GodFather has quit [Ping timeout: 256 seconds]
<xco> ?
roadie has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.5]
<phaul> syntactically looks like a constant. Most probably pointing to a class.
<phaul> based on that new is called on it
<xco> ;)
roadie has quit [Ping timeout: 264 seconds]
TCZ has quit [Quit: Leaving]
<phaul> looks like test fixtures. for rspec.
<xco> thanks, i'll have to check this again tomorrow, 1am here