<johnjaye>
whatever this ruby on rails thing it doesn't seem that amazing. i had to literally go to a stackoverflow answer to figure out how to load it in the irb propmt
<johnjaye>
*prompt
John_Ivan has quit [Ping timeout: 246 seconds]
eddof13 has joined #ruby
crespire has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
konsolebox has joined #ruby
<weaksauc_>
johnjaye rails c
<weaksauc_>
or `rails console`
<weaksauc_>
it
<johnjaye>
idk what that is. bash and irb don't recognize a rails command
<weaksauc_>
well you have to have it installed as a gen
<weaksauc_>
m*
<weaksauc_>
and you should be in the context of a rails project
<weaksauc_>
but it loads everything up as an irb shell
<weaksauc_>
in the context of the project
<weaksauc_>
do the rails getting started guide and you will see
<johnjaye>
ok. i asked before because when i do help commands i see active_support listed
<ox1eef_>
'bundle exec rails c', or: ./bin/rails c
<johnjaye>
i don't have /bin/rails or anything like that.
<johnjaye>
i'm not sure how active_support got put into ruby. this is a debian-flavored system
<ox1eef_>
'bundle exec rails c' then, but I think there's the options of bin stubs too (eg ./bin/rails). Maybe not default.
<johnjaye>
i get cannot locate gemfile or current bundle directory. is bundle like a package manager?
<ox1eef_>
Have you run 'rails new my_app', and changed directory into 'my_app' ?
<johnjaye>
that's the thing, i don't think i have rails installed at all. it seems to be a separate package.
<johnjaye>
on debian ruby-rails. so idk why i have active_support listed from the regular ruby2.7 package
<ox1eef_>
Yep. Bundler manages gem dependencies. And with Gemfile.lock, it makes sure the versions of gems used is always the same. Kind of a sandbox, because what's not in Gemfile.lock cannot be required.
<johnjaye>
anyway it's moot since i don't want to develop with rails in particular. i just didn't understand why i had it but not the official package
<ox1eef_>
I'd suggest not using apt for Ruby stuff.
<ox1eef_>
It's usually dated, and butchered to pieces. Just a frustrating experience all round.
<johnjaye>
meaning?
<johnjaye>
ok. but how do i do it otherwise. some kind of bash script thing like rust does?
Sankalp has quit [Ping timeout: 246 seconds]
shokohsc5105 has joined #ruby
<ox1eef_>
On my other computer I use FreeBSD, and their installation of Ruby is also butchered. So I basically compile it by hand, via my own port (https://github.com/0x1eef/ports/tree/main/freebsd/lang/ruby32-std). On this computer I use OpenBSD, and it has a normal Ruby, so I just use their package.
<ox1eef_>
In your case, you can compile by hand or use a ruby version manager. (rbenv, ruby-install / chruby).
shokohsc510 has quit [Ping timeout: 244 seconds]
shokohsc5105 is now known as shokohsc510
<konsolebox>
johnjaye: active_support can be used by non-rails gems too
<johnjaye>
ok. i thought active support was synonymous with rails.
<johnjaye>
i don't really know enough to grasp these subtleties.
<ox1eef_>
Rails is a collection of gems. active record, active support, action mailer, etc.
<ox1eef_>
If you have active support but not rails, you are probably using another gem that brought in active support.
<johnjaye>
as far as i know i just apt-get installed ruby
<ox1eef_>
Every gem that says 'default:', that's part of Ruby but things like activesupport, concurrent-ruby, and more are something installed by 'gem install x'.
<johnjaye>
i don't recall doing gem install anything
<johnjaye>
maybe i did one time and forgot
Sankalp has joined #ruby
<johnjaye>
it says i installed something called ruby-tty-command
<ox1eef_>
Possible.
<johnjaye>
my assumption was debian just installed active_support when you do ruby
<ox1eef_>
Don't install gems as root though. Setup $GEM_HOME / $GEM_PATH if you didn't already.
<ox1eef_>
I don't think so.
<konsolebox>
GEM_HOME / GEM_PATH hacks are the reason to just avoid using system Ruby completely. It's rare for a distro to get its defaults done right and it has ti adapt with Rubygem's constant changes.
<johnjaye>
i see
<leftylink>
I would really hope activesupport wouldn't get installed by default. if I ask for Ruby to installed, I expect Ruby to get installed, not some unwanted gem that I didn't ask for
<johnjaye>
hmm. i'm not sure exactly. my apt history doesn't show much. but then dpkg shows i do have a lot of gems installed. so my guess is it's the default
<johnjaye>
if i get a chance to investigate later with a debian vm i can try
<konsolebox>
johnjaye: Are those gems part of a package? They're likely dependencies called by other packages, unless you installed a gem in system install mode with `gem install`.
<konsolebox>
I mean active_support surely can't be part of the core Ruby package. That certainly would be surprising.
<cxl>
Hi all, what is the right way to add months and years to Time.now? Doing it with ActiveSupport's `months` and `years` gives odd results since it uses seconds to make the calculation. Doing it with the seconds as in ActiveSupport gives: Time.now => 2023-08-08