thecoffemaker has quit [Ping timeout: 260 seconds]
pwnd_nsfw` has joined #ruby
claw has quit [Ping timeout: 246 seconds]
thecoffemaker has joined #ruby
i9zO5AP has quit [Quit: WeeChat 2.5]
claw has joined #ruby
pwnd_nsfw has quit [Ping timeout: 260 seconds]
<havenwood>
Jack-20: RubyGems is what we call the Ruby package manager that ships with Ruby. The `gem` command can be used to do things including installing gems, publishing gems, and running your own gem server. RubyGems is itself a gem, meaning a Ruby library packaged as a gem.
Swyper has joined #ruby
<havenwood>
Jack-20: Bundler is another gem that ships with Ruby. Bundler is itself a gem, it's just already pre-installed since it's a "default gem" for Ruby. More and more of the Ruby stdlib is being "gemified." You can see which gems are default gems at this point here: https://stdgems.org/
<havenwood>
Jack-20: Bundler adds more advanced dependency resolution to RubyGems with the `bundle` command.
skx86 has joined #ruby
<havenwood>
Jack-20: RubyGems and Bundler are in the process of being merged.
Swyper has quit [Remote host closed the connection]
<havenwood>
Jack-20: Think of RubyGems as the package manager and Bundler as a dependency resolver addon.
<havenwood>
Jack-20: RubyGems lets you install Ruby libraries. Bundler lets you manager the dependencies for an app that has many libraries.
fphilipe has joined #ruby
mossplix has quit [Remote host closed the connection]
<Jack-20>
havenwood Thanks. Soo the job of Bundler is to put the librairies into an app folder ?
<havenwood>
Jack-20: Bundler introduced the concept of an Gemfile file to list the gems you want, then you run `bundle` and Bundler creates a Gemfile.lock file that contains the exact versions of each gem that it resolved dependencies to.
<havenwood>
Jack-20: These days you can create a Gemfile.lock from a Gemfile with just Rubgems, but Bundler has more advanced features.
<havenwood>
Jack-20: The RubyGems command would be: gem install -g Gemfile
<havenwood>
Jack-20: The Bundler equivalent is: bundle
<havenwood>
Jack-20: `gem -h` and `bundle -h` should get you started on other features.
<havenwood>
Jack-20: To install a gem named "hola": gem install hola
<havenwood>
Jack-20: To install all the dependencies in your Gemfile.lock, or generate one if you just have a Gemfile: bundle
<havenwood>
Jack-20: For example, to start a new app i a jack-20 directory with a Gemfile that only lists the hola gem:
<havenwood>
Jack-20: Or just install the gem directly: gem install hola
<havenwood>
Jack-20: The advantage of a Gemfile is you can resolve multiple gems so they are versions that work together. The Gemfile.lock pattern was also adopted by Node.js's Yarn (yarn.lock) and Rust's Cargo (Cargo.lock).
<havenwood>
(Yehuda.)
mossplix has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
fphilipe has quit [Ping timeout: 252 seconds]
zlogan2003 has quit [Ping timeout: 248 seconds]
etupat has quit [Remote host closed the connection]
<Jack-20>
havenwood OK. So bundler install all gems listed in a file (the Gemfile) and make sure that all Gems work, while RubyGems just allow to install individual Gem, and doesn't provided warranty ?
etupat has joined #ruby
<Jack-20>
that they will all work
<Jack-20>
together
ur5us has quit [Ping timeout: 260 seconds]
skryking has quit [Ping timeout: 240 seconds]
<havenwood>
Jack-20: These days, RubyGems can do both, but the `bundle` command is the more commonly used interface for historical reasons as well as features.
<havenwood>
Jack-20: But yes. RubyGems lets you create, host, and install gems.
etupat has quit [Remote host closed the connection]
<havenwood>
Jack-20: Bundler lets you make sure that multiple gems work together.
AJA4350 has quit [Quit: AJA4350]
skryking has joined #ruby
<havenwood>
Jack-20: Some people use Bundler to create gems. You then build and host the gem with RubyGems. The line between RubyGems and Bundler is even less clear now that RubyGems can resolve dependencies and the merger of RubyGems and Bundler has begun.
<havenwood>
Jack-20: I'd suggest just thinking of `gem` as the package manager and `bundle` as a dependency resolver for when you have a Gemfile.
alex has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
<havenwood>
Jack-20: You can pretty much do everything except resolve dependencies for a Rails app with just RubyGems.
<havenwood>
Jack-20: For a regular Gemfile, it works just fine to: gem install -g Gemfile
<havenwood>
As I've mentioned, most folk use Bundler for historical and robustness reasons.
<havenwood>
Jack-20: If you don't have a Gemfile, don't worry about Bundler.
lxsameer has quit [Ping timeout: 265 seconds]
<havenwood>
Jack-20: If you do have a Gemfile, install the deps with: bundle
turbo_choo has joined #ruby
ur5us has joined #ruby
budonyc has joined #ruby
Fridtjof has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
<Jack-20>
havenwood Thank you very much
<havenwood>
Jack-20: You're very welcome
mossplix has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
Jack-20 has quit [Remote host closed the connection]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
nima_m has quit [Quit: Connection closed for inactivity]
phaul has joined #ruby
turbo_choo has quit [Ping timeout: 268 seconds]
turbo_choo has joined #ruby
DaRock has joined #ruby
Fridtjof has joined #ruby
turbo_choo has quit [Ping timeout: 268 seconds]
mossplix has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
Technodrome has joined #ruby
phaul has joined #ruby
turbo_choo has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
etupat has joined #ruby
wildtrees has quit [Quit: Leaving]
claw has quit [Ping timeout: 248 seconds]
turbo_choo has quit [Ping timeout: 260 seconds]
phaul has quit [Ping timeout: 258 seconds]
mossplix has quit [Remote host closed the connection]
phaul has joined #ruby
turbo_choo has joined #ruby
akemhp has quit [Ping timeout: 260 seconds]
phaul has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
claw has joined #ruby
turbo_choo has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
Swyper has quit [Remote host closed the connection]
DaRock has quit [Ping timeout: 268 seconds]
DaRock_ has joined #ruby
turbo_choo has joined #ruby
phaul has quit [Ping timeout: 260 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
Emmanuel_Chanel has joined #ruby
akemhp has joined #ruby
phaul has joined #ruby
budonyc has quit [Ping timeout: 268 seconds]
budonyc has joined #ruby
fphilipe has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 258 seconds]
budonyc has quit [Quit: Leaving]
phaul has joined #ruby
gix- has quit [Ping timeout: 265 seconds]
etupat has quit [Remote host closed the connection]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
william1_ has quit [Quit: WeeChat 1.9.1]
william1 has joined #ruby
Nicolab has joined #ruby
suukim has quit [Quit: Konversation terminated!]
jaequery_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
taq has joined #ruby
sepp2k has joined #ruby
ur5us has joined #ruby
impermanence has joined #ruby
schne1der has joined #ruby
wildtrees has quit [Quit: Leaving]
errst has joined #ruby
Nahra has joined #ruby
<jidar>
I'm attempting to begin/rescue a rake task that calls to shell, but for whatever reason I can't figure out the exception I should be checking for. The shell return code is 0 or 1, and I want to catch on 1 and continue. What might this look like? Current code looks like the following: https://gist.github.com/0d225f10d8d0f7569803df7257c915b1
jaequery_ has quit [Remote host closed the connection]
wickedbloodfart has quit [Ping timeout: 268 seconds]
<kristian_on_linu>
so, I'll try to make it short ... I have a bunch of jekyll sites, and I got a new laptop so I decided to get a new version of ruby as well ... I am now on 2.7.0 (and jekyll 4.0.0)
ellcs1 has quit [Ping timeout: 248 seconds]
<xeyler>
Hey, folks! I'm trying to get a development environment set up for my jekyll site. When I run 'bundle exec jekyll serve', I get 'jekyll 3.8.5 | Error: uninitialized constant Faraday::Error::ClientError'.
yokel has quit [Ping timeout: 265 seconds]
<kristian_on_linu>
when I try to build one of my sites, I get "warning: Using the last argument as keyword parameters is deprecated" ... I tried googling this, but I can't figure out what to do
yokel has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
xeyler: That error was reamed Faraday::ClientError in a newer version of Faraday.
<havenwood>
xeyler: Check if your Faraday version is too new for your code.
<havenwood>
xeyler: Consider pinning Faraday to an older version or update the code.
<kristian_on_linu>
sample output: /home/kristian/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/lib/jekyll/convertible.rb:41: warning: Using the last argument as keyword parameters is deprecated
<kristian_on_linu>
I'll put convertible.rb up somewhere, hang on
<havenwood>
kristian_on_linu: The solution is to add explicit Hash literal braces.
<havenwood>
kristian_on_linu: {}
<havenwood>
kristian_on_linu: Someone needs to update the Jekyll code.
<kristian_on_linu>
I found both of that links, but I can't quite grok them
<xeyler>
kristian_on_linu: https://github.com/jekyll/jekyll/issues/7947 The github issue is fairly recent. There could already be a patch that fixes it. It seems to be an issue with jekyll more than your versions.
<xeyler>
Ah, havenwood got it already... My bad
<xeyler>
havenwood: regresssing faraday from 1.0.0 to 0.17.3 seems to solve the issue
<kristian_on_linu>
I'm looking at github now, can't seem to find a fix
ellcs1 has joined #ruby
<xeyler>
The fix is for jekyll source maintainers to update the code. They're aware of the issue, at least, so it's just a matter of time.
<kristian_on_linu>
for now, I would like to just fix it manually
sparc has left #ruby [#ruby]
<xeyler>
kristian_on_linu: it's just a warning though, so it shouldn't break your build... does it?
<kristian_on_linu>
my build barely completes and gives me a ton of warnings and such ... so I'm trying to weed them out one by one
<kristian_on_linu>
I jumped from a quite old jekyll also
<kristian_on_linu>
and a messy install of everything :)
<xeyler>
Which version are you currently using?
<kristian_on_linu>
4.0.0
schne1der has quit [Ping timeout: 268 seconds]
<kristian_on_linu>
havenwood: can you elaborate on the {} stuff?
jaequery has quit [Remote host closed the connection]
<havenwood>
kristian_on_linu: In 2.7, that ^ warns.
<havenwood>
kristian_on_linu: This doesn't: foo({aim: true})
jaequery has joined #ruby
<havenwood>
kristian_on_linu: For a better example, see the "Here is another case. You can use braces ({}) to pass a Hash instead of keywords explicitly." in the link above.
<havenwood>
kristian_on_linu: "In Ruby 2.7: The keyword is converted to a positional Hash argument"
<havenwood>
kristian_on_linu: In Ruby 3, it will raise an ArgumentError, unless you use ruby2_keywords.
<havenwood>
(It's best to just switch to explicit ** and {}.)
<kristian_on_linu>
this stuff is a bit over my head :)
<havenwood>
kristian_on_linu: It's just how Ruby used to assume things are position or keyword is changing for Ruby 3. This warning is a shot across the bow, warning of the impending change.
<havenwood>
kristian_on_linu: Jeykl will fix the issue. You can safely ignore it for now.
<havenwood>
kristian_on_linu: If you run into a warning in your own code, let us know and we can show the new way. It kinda only applies to edge cases, but common enough you'll see this warning around for a few months in various libraries.
<havenwood>
By warning now, everyone will be fixed before it really changes in Ruby 3, next Christmas.
<kristian_on_linu>
let's hope so
<kristian_on_linu>
I thought I just had to fix some brackets
<havenwood>
kristian_on_linu: Yeah, but it's brackets in the Jekyll code. You can fix it yourself, and even make a PR to fix it for everyone else.
<havenwood>
kristian_on_linu: But it's in Jekyll's code, not yours, if I'm reading this right.
<kristian_on_linu>
indeed
<kristian_on_linu>
can you show me for that line 41, then I'll try to work from there?
<havenwood>
kristian_on_linu: That doesn't seem like the right line. Hrmm. Could you paste the full error output?
<havenwood>
kristian_on_linu: Yikes, I don't get it...
<havenwood>
kristian_on_linu: Yeah, I don't actually see what the issue is here. I expected it to be a simple solution, but where is this error coming from?!!?
<havenwood>
kristian_on_linu: Okay, wow, that's hard to track. It was the #site method from line 41, I believe.
<xeyler>
kristian_on_linu Is probably using a different version, right? Maybe a couple commits have changed what we ought to be looking at?
<xeyler>
Oh, that's strange... Does that just have to do with the way Ruby treats objects and method calls? Sorry, I'm not actually familiar with Ruby. I'm more familiar with C, Java, and the like
<havenwood>
xeyler: Normally it'd get the right line in the stacktrace. This warning pointed to the caller rather than callee that actually has the warned issue. ¯\_(ツ)_/¯
unyu has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xeyler>
That's weird... But I wanted to thank you for your help. My version of faraday was just too recent, apparenly. But now that I've downgraded, it works!
<havenwood>
kristian_on_linu: It looks like that fixes the line 179 issue too, just in a very roundabout way.
<havenwood>
xeyler: woot!
<havenwood>
kristian_on_linu: Unsure, but from following the calls, I think #site is the issue with both.
<xeyler>
Hmm... I just commented out my 'faraday < 1.0.0' bundler rule in my gemfile, then ran 'bundle update'. It updated faraday to 1.0.0 again, but jekyll hasn't broken again.
<xeyler>
Maybe faraday was okay, but I had an earlier version of something?
<havenwood>
xeyler: run: bundle update faraday
alexherbo2 has joined #ruby
<havenwood>
xeyler: oh
<havenwood>
xeyler: what's keeping faraday pinned at < 1
<havenwood>
?
<xeyler>
I edited my gemfile manually. The mismatched faraday class names was because jekyll expected an earlier version of faraday
<havenwood>
xeyler: It's normal to edit the Gemfile manually, but not the Gemfile.lock, which is actually used to pick versions.
<havenwood>
xeyler: What's depending on an early Jeykll in your Gemfile.lock
<xeyler>
github-pages
<kristian_on_linu>
havenwood: laundry took longer than expected, pardons
<havenwood>
xeyler: My first thought is try Bundle updating GitHub pages. You might review the changelog to see if anything is relevant before a: bundle update github-pages
<havenwood>
kristian_on_linu: Np, it's a cryptic error and it looks to me like both lines call #site under the hood—where the actual issue lies.
<havenwood>
kristian_on_linu: This is hard to track down, which is probably why the Jekyll issue is still open.
<kristian_on_linu>
I see
<havenwood>
kristian_on_linu: There may be other sites that call it with a similar issue. This is just one method that explains the error.
<havenwood>
kristian_on_linu: It makes me wonder if the warning could be improved to point to the actual caller.
<havenwood>
(It's a new warning, so possible.)
<havenwood>
kristian_on_linu: It seems like you'd have to exercise a debugger or grep the code for hashrockets or 1.9-style keywords or something to fix this. Maybe someone will write an AST automagical fix.
* havenwood
stares at baweaver
<kristian_on_linu>
what happened was that my Gemfile.lock gave me some headaches so I went ahead and installed everything in it, figuring I would then fix the jekyll files
<havenwood>
kristian_on_linu: It's normal to install all the dependencies in the Gemfile.lock by running: bundle
<havenwood>
kristian_on_linu: Then use those exact versions by prefixing `bundle exec` to your commands.
<kristian_on_linu>
yeah, but what I did was edit it so it would gem install everything
<havenwood>
kristian_on_linu: everything, as in the newest versions of each gem?
<kristian_on_linu>
yes
<havenwood>
kristian_on_linu: You can resolve to the latest versions of each gem, with: bundle update
<kristian_on_linu>
ah
<havenwood>
kristian_on_linu: It tends to break things, so many folk `bundle update foo` one at a time with gems and run the tests.
<kristian_on_linu>
I was heading for something like that, but I got impatient
<havenwood>
kristian_on_linu: You can also `bundle update foo --conservative` to update fewer downstream dependencies.
<kristian_on_linu>
and also Gemfile.lock was sort of resetting itself ... which was infuriating :)
<xeyler>
Oh, I think maybe I just needed to run bundle update to update my Gemfile.lock?
okuu has joined #ruby
<xeyler>
I did some configuring in the Gemfile before, but never ran 'bundle update'
<kristian_on_linu>
havenwood: a few gems were updated
unyu has quit [Ping timeout: 260 seconds]
<kristian_on_linu>
I still get the error messages, but I guess I'll leave it be for now
<kristian_on_linu>
if they are only warnings, it's not them causing my css to break (and so on)
ellcs1 has quit [Ping timeout: 248 seconds]
<havenwood>
kristian_on_linu: yup, and normal to have warnings so close to a major version release since gems haven't all updated yet.
<kristian_on_linu>
yeah, I'll just let the good people at jekyll sort it out
<havenwood>
these are Ruby 3 warnings too, on the last major release before Ruby 3
<havenwood>
they will!
okuu is now known as unyu
<kristian_on_linu>
this is mainly hobby stuff for me, it's not like I need it running tomorrow morning
<kristian_on_linu>
btw, do you people know if jaybe is still active?
* havenwood
debates if jaybe is a thing or typo version of jekyll
<havenwood>
kristian_on_linu: i haven't heard of it
<havenwood>
now I'm thinking that was jekyll, since no jaybe gem
<kristian_on_linu>
he (?) used to be very active in jekyll, on irc and reddit
<havenwood>
kristian_on_linu: ahhhh, a person!
drincruz has quit [Ping timeout: 258 seconds]
<havenwood>
kristian_on_linu: I don't know. Sounded familiar but I couldn't place it. Someone else here probably know of them.
<kristian_on_linu>
it's not a big deal
<xeyler>
kristian_on_linu: Would you happen to have some good documentation on creating a jekyll theme?
<kristian_on_linu>
no, I usually just find one and tweak it
<xeyler>
Now that my development and production environments are set up, I think that's the last piece to the puzzle
<kristian_on_linu>
and sometimes I go with the defaut one, and tweak that
<xeyler>
Hmm... I like the default one, but I think it could be interesting to set one up from scratch.
<xeyler>
Maybe I'll hop on the jekyll irc
<kristian_on_linu>
if I may offer a piece of advise, shop around a bit before you settle for a theme ... many of them look good, but only in one browser/resolution and such
<xeyler>
Yeah, after spending a year as a web dev, I can tell that the frontend has its fair share of horror stories(not to say the backend doesn't)