Nanoc on Pop!OS

15 views
Skip to first unread message

Tom Cloyd

unread,
Oct 18, 2022, 9:51:19 AM10/18/22
to nanoc
I have used nanoc with joy for years. Very recently I've switched to Pop!_OS Linux and I can't get my standard workflow going.I'm using the same website source files I have been successfully using on Kubuntu

"bundle exec nanoc view" yields that "LoadError: Couldn't find handler for: puma, thin, falcon, webrick." error message

But when I add "bundle add webrick" to my Gemfile I get -

"[!] There was an error parsing `Gemfile`: Undefined local variable or method `webrick' for Gemfile. Bundler cannot continue."

My gemfile:

bundle add webrick
gem 'nanoc', '~> 4.12.7'

group :nanoc do
gem 'guard-nanoc'
end

gem 'adsf' # web server
gem 'kramdown' # markdown!
gem 'nokogiri' # for nanoc check: internal links
gem 'w3c_validators' # for nanoc check: css

end

I'll admit to being only minimally clued in as to what most of this is doing.

Can someone point out where I'm going wrong here? I urgently need to do website work today.

Thanks!

Denis Defreyne

unread,
Oct 18, 2022, 10:46:04 AM10/18/22
to noreply-spamdigest
Hey Tom,

The bundle add webrick bit is a command that is intended to run in the terminal — it’s not meant to be added literally to the Gemfile.

I realise that the instructions regarding this on the Nanoc web site (https://nanoc.app/doc/installation/#ruby-3-x) are ambiguous. I’ll update them in a minute.

Hope this helps,

Denis Defreyne
[dəˈni] • pronouns: he/him

--
You received this message because you are subscribed to the Google Groups "nanoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanoc+un...@googlegroups.com.

Tom Cloyd

unread,
Oct 18, 2022, 3:19:21 PM10/18/22
to nanoc
Thanks Denis, but I'm still lost in the woods.

I cleaned up my Gemfile. Then...

 tomc@pop-os:~/Dropbox/www/__Active/TaD$ bundle add webrick
[DEPRECATED] This Gemfile does not include an explicit global source. Not using an explicit global source may result in a different lockfile being generated depending on the gems you have installed locally before bundler is run. Instead, define a global source in your Gemfile like this: source "https://rubygems.org".
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Your bundle is locked to webrick (1.7.0) from locally installed gems, but that version can no longer be found in that source. That means the author of webrick (1.7.0) has removed it. You'll
need to update your bundle to a version other than webrick (1.7.0) that hasn't been removed in order to install.
tomc@pop-os:~/Dropbox/www/__Active/TaD$ bundle update
[DEPRECATED] This Gemfile does not include an explicit global source. Not using an explicit global source may result in a different lockfile being generated depending on the gems you have installed locally before bundler is run. Instead, define a global source in your Gemfile like this: source "https://rubygems.org".
Fetching gem metadata from https://rubygems.org/...........
Could not find gem 'webrick (~> 1.7)' in locally installed gems.

First - this makes no sense to me: "This Gemfile does not include an explicit global source." The first line of my Gemfile is as you see it above - "
source 'https://rubygems.org' do"

Second - I don't know how to respond to the webrick version issue.

Suggestions?

Thank you.

Tom

Denis Defreyne

unread,
Oct 18, 2022, 3:28:38 PM10/18/22
to noreply-spamdigest
Hey Tom,

The deprecation message is likely because you’ve specified #source as a block. You can instead call #source without a block. Here’s a Gist that shows the comparison between the two versions: https://gist.github.com/denisdefreyne/aef71df3c2e676fab04084bbe717ef1f (the “after” one is the one you want).

The webrick error looks like it’s a separate issue. Can you try running bundle update webrick? That should hopefully get it working again.

Cheers,

Denis Defreyne
[dəˈni] • pronouns: he/him


Tom Cloyd

unread,
Oct 18, 2022, 4:42:30 PM10/18/22
to nanoc
Thank you for your quick response. Very much appreciated.

Your suggestion resolved the deprecation message issue.

Then:

$ bundle update webrick
Could not find gem 'webrick'.

I am totally clueless as to what to do next. Further help would be much appreciated.

Thank you!

Denis Defreyne

unread,
Oct 19, 2022, 3:24:54 AM10/19/22
to noreply-spamdigest
Hey Tom,

Does `bundle add webrick` work for you now, with the revised Gemfile?

Best,

Denis Defreyne
[dəˈni] • pronouns: he/him


Tom Cloyd

unread,
Oct 19, 2022, 3:31:32 PM10/19/22
to nanoc
Yes, and nanoc is now running fine for me.

Initially it didn't work, so I opened my package manager (Muon) and purged everything having to do with Ruby, assuming I'd messed thing up fairly well somehow.

Then I installed the default Ruby, which brought in with it a number of other packages.

Next I installed bundler from the packages.

I installed nanoc with "sudo gem install nanoc", ran "bundle update" and gave the root password when asked.

Then I issued "bundle add webrick" and it ran fine.

"bundle exec nanoc live" then executed normally.

I give you this sequence of steps I went through thinking it might be useful to you in writing documentation.

Thank you, Denis, for your prompt and valuable assistance. My new website will have a colophon page where nanoc will be prominently mentioned.

Tom
Reply all
Reply to author
Forward
0 new messages