<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]
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]
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]
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:
<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.
<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 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!
<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>
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: 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>
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?
<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.
<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?
<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
<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.
<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.
<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]
<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>
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>
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.
<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?
<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:
<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
<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