tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsujp has joined #ruby
Fernando-Basso has joined #ruby
_whitelogger has joined #ruby
jmcgnh has quit [Ping timeout: 244 seconds]
jmcgnh has joined #ruby
cd has quit [Quit: cd]
mat_bug has joined #ruby
jottr__ has joined #ruby
rubydoc has quit [Ping timeout: 272 seconds]
gix- has quit [Ping timeout: 244 seconds]
bitwinery has quit [Quit: Leaving]
conta has joined #ruby
jottr__ has quit [Ping timeout: 258 seconds]
conta has quit [Quit: conta]
conta has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
kent\n has joined #ruby
poontangmessiah_ has joined #ruby
poontangmessiah_ has quit [Max SendQ exceeded]
poontangmessiah_ has joined #ruby
poontangmessiah_ has quit [Max SendQ exceeded]
poontangmessiah has quit [Ping timeout: 258 seconds]
poontangmessiah_ has joined #ruby
poontangmessiah_ has quit [Max SendQ exceeded]
poontangmessiah_ has joined #ruby
poontangmessiah_ has quit [Remote host closed the connection]
Rudd0 has quit [Remote host closed the connection]
involans has joined #ruby
conta has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
poontangmessiah has quit [Max SendQ exceeded]
poontangmessiah has joined #ruby
hyuke has quit [Ping timeout: 244 seconds]
poontangmessiah has quit [Max SendQ exceeded]
poontangmessiah has joined #ruby
hyuke has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
conta has joined #ruby
TomyWork has quit [Remote host closed the connection]
conta has quit [Quit: conta]
conta has joined #ruby
drincruz_ has joined #ruby
drincruz_ has quit [Ping timeout: 244 seconds]
kent\n has quit [Quit: Quitting]
Rudd0 has joined #ruby
involans has quit [Quit: involans]
TomyWork has joined #ruby
kent\n has joined #ruby
jottr__ has joined #ruby
TomyWork has quit [Remote host closed the connection]
jottr__ has quit [Ping timeout: 258 seconds]
jottr__ has joined #ruby
conta has quit [Quit: conta]
jottr__ has quit [Ping timeout: 244 seconds]
conta has joined #ruby
conta has quit [Quit: conta]
conta has joined #ruby
tdy1 has quit [Ping timeout: 246 seconds]
nerdius has quit [Read error: Connection reset by peer]
nerdius has joined #ruby
Inline__ has joined #ruby
jottr__ has joined #ruby
Inline__ has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 264 seconds]
CrazyEddy has quit [Ping timeout: 244 seconds]
Inline has joined #ruby
tdy1 has joined #ruby
involans has joined #ruby
gigetoo has quit [Ping timeout: 245 seconds]
yokel has quit [Ping timeout: 258 seconds]
jottr__ has quit [Ping timeout: 245 seconds]
Nicmavr has quit [Ping timeout: 245 seconds]
gigetoo has joined #ruby
tdy1 has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
yokel has joined #ruby
mikecmpbll has joined #ruby
shirak_ has joined #ruby
DaniG2k has joined #ruby
DaniG2k has quit [Client Quit]
foxxx0 has quit [Quit: foxxx0]
Fernando-Basso has quit [Remote host closed the connection]
Tristan-Speccy has joined #ruby
rubydoc has joined #ruby
foxxx0 has joined #ruby
jottr__ has joined #ruby
jottr__ has quit [Ping timeout: 268 seconds]
<barg>
am i supposed to have a system bundle and a regular bundle?
<barg>
-/usr/local/bin/bundle, and /usr/local/opt/ruby/bin/bundle ?
AJA4350 has joined #ruby
<barg>
also why is system ruby in /usr/bin whereas (system?) bundle is /usr/local/bin/ ?
<barg>
also, i thought i had just two bundles, system and regular, but turns out i actually have three bundles.. third being /usr/local/lib/ruby/gems/2.6.0/bin what's the purpose of that one?
reber has joined #ruby
shirak_ has quit [Remote host closed the connection]
shirak_ has joined #ruby
shirak__ has joined #ruby
shirak_ has quit [Ping timeout: 245 seconds]
jottr__ has joined #ruby
conta has quit [Quit: conta]
kyrylo has joined #ruby
jottr__ has quit [Ping timeout: 268 seconds]
mikecmpb_ has joined #ruby
mikecmpbll has quit [Ping timeout: 248 seconds]
elated has joined #ruby
suukim has quit [Quit: Konversation terminated!]
shirak__ has quit [Ping timeout: 244 seconds]
tdy1 has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
mynameisdebian has joined #ruby
ellcs has joined #ruby
mynameisdebian has quit [Ping timeout: 272 seconds]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
Swyper has joined #ruby
bmurt has joined #ruby
lucasb has joined #ruby
ellcs has quit [Ping timeout: 250 seconds]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
chunkypuffs has quit [Remote host closed the connection]
<havenwood>
barg: I linked this yesterday, which explains default gems: https://stdgems.org/
<havenwood>
barg: Note, the default and bundled gems ship with Ruby and are in a different directory than gems you install.
<havenwood>
barg: GEM_HOME is the dir where gem install. GEM_PATH is a colon delimited list of dirs that Ruby will look for gems in.
<havenwood>
barg: It's normal for gems to install in only one place, but to look for default gems in addition to that place.
Esa_ has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
henninb has joined #ruby
zombyz03 has joined #ruby
zombyz03 has quit [Excess Flood]
Esa_ has quit []
Xiti has quit [Quit: Xiti]
jottr__ has joined #ruby
aphprentice__ has joined #ruby
jottr__ has quit [Ping timeout: 268 seconds]
<IGnorAND>
o/
<IGnorAND>
I have several rules I want to check on. I made different classes (check_if_starts_with_dash, check_if_ends_in_dash, check_minimum_length, check_maximum_length etc) Would it make sense to make these self functions so I dont instantiate the objects
<havenwood>
IGnorAND: Those look like functions that would be fine in a module instead of a class.
<IGnorAND>
havenwood: yeah, trying to apply ruby logic to php. php has no modules.
<IGnorAND>
well, not in the same sense
jottr__ has joined #ruby
<havenwood>
IGnorAND: It's hard to say without more context. I'd suggest a module if you have no state, a singleton class if you have a single instance of state, and a class if you have multiple instances of state.
<havenwood>
IGnorAND: Modules with module_function allow direct, explicit usage or including the module.
reber has quit [Remote host closed the connection]
conta has joined #ruby
uranoss has joined #ruby
suukim has joined #ruby
<barg>
havenwood: thanks. GEM_HOME and GEM_PATH are created by RVM thought, right? so I guess only apply when one has/uses RVM. The command you mentioned earlier- gem env gemdir is good.. I just looked at stdgems.org, they link to a video explaining things, though unfortunately the guy doing the video doesn't speak English clearly
ZAJDAN has quit [Read error: Connection reset by peer]
ZAJDAN has joined #ruby
jottr__ has joined #ruby
<havenwood>
barg: GEM_HOME and GEM_PATH are RubyGems things that aren't specific to RVM.
<havenwood>
barg: RubyGems has defaults for these two locations. Those two environment variables will override the defaults. RVM and chruby happen to use those to set Ruby behavior, but they are part of RubyGems and you can use them directly if you'd like.
<barg>
if i do echo $GEM_HOME I get nothing
<havenwood>
barg: Then it's unset and the default is used.
kyrylo has quit [Read error: Connection reset by peer]
<havenwood>
barg: You can see your GEM_PATH equivalent with: gem env gempath
<havenwood>
barg: If you set GEM_PATH, it will override that.
jottr__ has quit [Ping timeout: 258 seconds]
<havenwood>
barg: These are RubyGems conventions.
<havenwood>
barg: I referred to the GEM_HOME and GEM_PATH by the environment variables, since that's what folk use to override the default locations. You could alternatively just say gem home and gem path.
<havenwood>
barg: The default gem home is a single location to install gems. The default gem path is a colon delimited list of places to look for gems. Does that make sense?
englishm has quit [Excess Flood]
jottr__ has joined #ruby
englishm has joined #ruby
Flyingdog has joined #ruby
jottr__ has quit [Ping timeout: 245 seconds]
D9 has quit [Ping timeout: 245 seconds]
<barg>
so i understand that there are two locations that gems are installed, one for default and bundled gems, and one for gems i install. I see three gem related paths listed by gem env, /Library/Ruby/Gems/2.3.0 and /Users/apple/.gem/ruby/2.3.0 and /System/Library/Frameworks/Ruby.framewo... Which is which?
FrostCandy has joined #ruby
SeepingN has joined #ruby
_falsebay_ has joined #ruby
<havenwood>
barg: What is the output of: gem env gem_path
<havenwood>
barg: That is your gem path.
orbyt_ has joined #ruby
<havenwood>
gem env gempath | tr ":" "\n"
<barg>
gem env gempath works, thanks
<havenwood>
barg: Those appear to be locations for the gem home, the --user-local gem home alternative, and the default gems.
<havenwood>
barg: As I've mentioned, system Ruby is for your system on macOS. Developers typically leave it alone.
<barg>
yeah, thanks
<havenwood>
barg: System Ruby installs to a path that requires sudo by default. You can install with a --user-local flag to target a fallback default location in your home directory.
<havenwood>
barg: Most folk don't bother to read up on RubyGems settings and just use RVM, chruby or rbenv to set those things properly if they're using multiple Rubies. Plenty of folk prefer to learn the RubyGems conventions, which seems to be what you want to do. I'd suggest looking more closely at the RubyGems code if you're interested.
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
<barg>
isn't it a bit dangerous to use something that runs on top of something else, without knowing the basics of what happens manually.. ?
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<barg>
it just adds more complexity and makes issues even harder to resolve
<barg>
because even more is hidden
kyrylo has quit [Read error: Connection reset by peer]
jottr__ has joined #ruby
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
jottr__ has quit [Ping timeout: 245 seconds]
<barg>
i had some old windows open with the old path, but with the newer path, i get this for gem env gempath /Users/apple/.gem/ruby/2.6.0:/usr/local/lib/ruby/gems/2.6.0:/usr/local/Cellar/ruby/2.6.3/lib/ruby/gems/2.6.0 Regarding the first directory, i don't have it on my system, which i guess is ok. I have /Users/apple/.gem/ruby/2.3.0/ so i guess that is ignored since it's not in the delimited paths
<barg>
. I recognise stuff /usr/local/lib/ruby/gems/2.6.0/bin as stuff I installed like nokogiri, and the third one, the Cellar one looks like some old stuff.. i heard cellar was brew related.
kyrylo has quit [Read error: Connection reset by peer]
<barg>
At the moment, the issue i see is that if i do rails new asdfsfsdfs then it says "No such file or directory -- /usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/exe/bundle (LoadError)" If I do which gem, it says /usr/local/opt/ruby/bin/gem and if i do gem --version it says 3.0.3 so should I do gem install bundler , or is there a version issue?
kyrylo has joined #ruby
<barg>
and if i do gem which bundler, then it says /usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/bundler.rb
ElFerna has joined #ruby
<barg>
if i do gem install bundler, it says "bundler's executable "bundle" conflicts with /usr/local/lib/ruby/gems/2.6.0/bin/bundle"
henninb has quit [Remote host closed the connection]
Sithembewena has joined #ruby
Sithembewena has quit [Client Quit]
<havenwood>
barg: gem install bundler --force
<havenwood>
barg: As to your question about it being dangerous to have abstractions that handle things properly, no, I don't think that's particularly dangerous.
<barg>
is it designed to work when underlying things are broken and conflicting?
<havenwood>
barg: It's more dangerous to have everyone doing it wrong without actually reading the code. Better to have someone who's read the code do it right and just use that.
<havenwood>
barg: For example, if you used chruby it would *just work* since the folk who wrote chruby understand the RubyGems internals.
<havenwood>
barg: That whole tool is just a couple hundred lines of code.
<barg>
but they can't control if somebody's path is wrong
<havenwood>
chruby does set PATH correctly
<havenwood>
¯\_(ツ)_/¯
<havenwood>
I do think the Homebrew post install instructions should be improved.
<barg>
i guess brew isn't so good for installing ruby
<havenwood>
It's fine, you just need to add your RubyGems bin/ dir to PATH, which they don't mention.
<barg>
right now i get an error when doing rails new sdfdsds3 Could not find 'bundler' (1.17.2) required by your /Users/apple/rubymac/sdfsdfdsfd3/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run `bundle update --bundler`. To install the missing version, run `gem install bundler:1.17.2`
<havenwood>
barg: Did you try its suggestion?
<havenwood>
bundle update --bundler
<barg>
was gonna say, should i run those two suggested commands, and in that order?
<barg>
ok
<havenwood>
barg: Then a plain ole: bundle
<havenwood>
barg: run Rails commands with: bin/rails ...
<havenwood>
For that matter, bundle with: bin/bundle
<havenwood>
barg: Normally, with bundle, you prefix your command with `bundle exec`, but Rails provides binstubs in bin/ dir.
<barg>
well, rails new sdfsfsd5 works since doing that second command
<barg>
-/usr/bin/rails --version says "Rails is not currently installed on this system".
<barg>
-/usr/local/bin/rails woks
<havenwood>
barg: bin/rails -v
<havenwood>
barg: (From the directory of your app.)
<havenwood>
barg: There's a bin/ folder in your Rails app directory. In that directory is a `rails` binstub that Rails means you to use.
<havenwood>
barg: From the directory of your Rails app, run: bin/rails -v
<havenwood>
barg: Or if you don't want to use that binstub, prefix `bundle exec` to your commands.
<havenwood>
Like: bundle exec rails -v
wallace_mu has joined #ruby
<havenwood>
Or: bin/rails -v
<havenwood>
barg: Does that make sense?
<barg>
well, rails new wouldn't be done with bin/rails
<barg>
also, they are the same rails version
<havenwood>
barg: No, normally you'd do that command with: rails _version here_ new
<havenwood>
barg: Like: rails _6.0.0.rc2_ new asdf
<havenwood>
barg: Unless you want to use the latest version of the Rails gem installed, in which case you can just: rails new asdf
<barg>
yeah i used the latest
<havenwood>
barg: You'll want to have the RubyGems bin/ dir of the Ruby you're using first in your PATH so you don't have to specify the full path of the `rails` command.
<havenwood>
barg: Once you've created an app, use `bundle exec rails` or `bin/rails`
<havenwood>
barg: You'll want to use the exact version of Rails from your Gemfile.lock, rather than whatever you happen to have installed at latest version.
<barg>
so ./bin in path?
<havenwood>
no
<havenwood>
barg: just relative to the root directory of your app
<havenwood>
barg: cd into your rails app, and type: bin/rails -v
<barg>
ok so no need for path for that
<havenwood>
barg: nope
<havenwood>
you don't need to have a command in PATH if you're calling it directly
<barg>
you mention having "the RubyGems bin/ dir of the Ruby you're using first in your PATH" Do you mean the project one?
<barg>
is the RubyGems bin dir the relative one?
<barg>
or one of the system-wide paths, if so, which?
ElFerna has quit [Ping timeout: 245 seconds]
<havenwood>
barg: echo "$(gem env gemdir)/bin"
<havenwood>
barg: that ^ directory
<havenwood>
barg: Look under EXECUTABLE DIRECTORY for: gem env
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
<barg>
thanks.. so what would've put rails in /usr/local/bin?
<barg>
(I understand i shouldn't run the rails in /usr/local/bin)
kyrylo has joined #ruby
SeepingN has joined #ruby
SeepingN is now known as Guest3542
fphilipe_ has quit [Ping timeout: 246 seconds]
kyrylo has quit [Client Quit]
MrCrackPot has joined #ruby
<havenwood>
barg: I don't know of any tools that would install Rails gem executable in /usr/local/bin. What'd you do? :P
<havenwood>
barg: That directory doesn't even ship with macOS. It's not where brew would install a gem, unless you changed the defaults.
<havenwood>
barg: If you set `export GEM_HOME="/usr/local/bin"` then did a `gem install rails` it would install there. But that's true for any directory.
<havenwood>
Also, don't do that and if you did, undo it.
<havenwood>
barg: If you've messed up brew too badly, you can always copy the list of packages you've installed `brew leaves | tr "\n" " " | pbcopy`, delete /usr/local and then reinstall Homebrew and reinstall your packages.
<barg>
ok, so you think i still shouldn't have a /usr/local/bin/rails file
<havenwood>
barg: That's not a normal thing to have on a brew install. I don't know how you ended up with that.
<barg>
would brew normally ever install rails?
<havenwood>
no
<barg>
ok thanks. i'll try to enquire why i might have that and see if i get any answers re that, before i try to fix it
<barg>
many thanks
<havenwood>
you installed it there, likely
<havenwood>
i told you my theory, you set it as gem home for a stint
<havenwood>
good luck!
<barg>
i doubt i did anything that weird! i don't even know what a stint is!
<barg>
and i only found out about GEM_HOME since you mentioned it a bit earlier!
involans has quit [Quit: involans]
Tempesta_ has joined #ruby
<havenwood>
barg: look at the file
<havenwood>
barg: you may find a clue
<barg>
a googleof /usr/local/bin/rails gets just over a million results
<havenwood>
barg: That's a popular directory for installing things on various distros.
Tempesta has quit [Ping timeout: 244 seconds]
<havenwood>
barg: Many distros have a Rails package.
<havenwood>
barg: Homebrew does not.
<barg>
oh maybe i tried another package manager besides brew
<barg>
like macports
jordanm has quit [Read error: Connection reset by peer]
<havenwood>
¯\_(ツ)_/¯
<barg>
with osx would /usr/local/bin normally not even be in the path?
jordanm has joined #ruby
<havenwood>
It doesn't even exist on a fresh macOS install...
<barg>
hehehe
<barg>
does brew put it in the path though?
orbyt_ has quit [Read error: Connection reset by peer]
<barg>
what's the point of brew putting all those shortcuts in there?
fphilipe_ has joined #ruby
<havenwood>
barg: Since /usr/local/bin isn't in PATH, Brew will prepend it.
<havenwood>
barg: Err, actually brew uses /usr/local/bin since it is in path. There are no files in /usr/local by default though.
<barg>
ok well i've added export PATH="$(gem env gemdir)/bin:$PATH"
<barg>
to my bash_prfoile
<havenwood>
(it used to not be)
<havenwood>
things change
orbyt_ has joined #ruby
<havenwood>
barg: I used to add it to PATH by editing /etc/paths, which I thought was nicer.
<havenwood>
See: sudo man path_helper
<barg>
yeah my rails file is not in /usr/local, it's in /usr/local/bin but i guess you're saying it still shouldn't be there... anyhow now it'll run the gemdir one 'cos i adjusted the path. Thanks
<barg>
-/usr/local is just directories
<havenwood>
barg: is it a file or symlink?
<havenwood>
barg: command -V /usr/local/bin/rails
<havenwood>
barg: what's in it?: head /usr/local/bin/rails
Exuma has joined #ruby
fphilipe_ has quit [Ping timeout: 250 seconds]
<havenwood>
barg: Normally, you prepend your RubyGems bin/ dir and Ruby bin/ dir to PATH, so these other commands are behind your currently used Ruby.