<cahoots>
hi, is there any ruby std lib function that takes a block and returns either the result of the block, or nil if an uncaught exception occurred within it?
Linux_Kerio has quit [Ping timeout: 268 seconds]
<weaksauce>
doesn't sound like a thing cahoots but also doesn't sound very hard to write yourself as a wrapper
<weaksauce>
def wrap(&block); block.call rescue nil end
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0]
Guest46 has quit [Quit: Client closed]
cek has quit [Quit: Connection closed for inactivity]
jidar has quit [Quit: Remote host closed the connection]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 268 seconds]
teclator has quit [Ping timeout: 260 seconds]
bovis has joined #ruby
<bovis>
https://bpa.st/FK53I I'm having trouble installing a gem (ruby bindings for mapnik https://github.com/mapnik/Ruby-Mapnik). The error is that compilation can't find a file rice/Enum.cpp. I have installed the rice gem, and the file does exist in /usr/lib/ruby/gems/3.1.0/gems/rice-4.0.4/rice/. What can I do?
cahoots has joined #ruby
cahoots has quit [Ping timeout: 255 seconds]
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 260 seconds]
<adam12>
bovis: Seems like a missing dependency.
<adam12>
bovis: what platform? and if linux, what distro?
teclator has joined #ruby
<bovis>
adam12: Alpine Linux. The gem calls for rake (for compilation), rice, and rcairo as dependencies. Those all installed without an issue.
<adam12>
bovis: ruby version
<adam12>
bovis: and rubygems version? (gem --version)
<adam12>
Actually, it looks like it generates those two files by combining headers.
<adam12>
Maybe you can go back a rice version.
<adam12>
gem install rice -v "~> 3.0"
<adam12>
That might not work 100% because you'll need to force that version of rice.
<adam12>
You could uninstall rice v4 as a hack. `gem uninstall rice -v "4.0"`. Then as long as you only have `gem list -l rice` as 3.0, it might all work.
<adam12>
^ bovis
<bovis>
adam12: Installing rice 3.0 and then trying mapnik again gave the same error as before
<adam12>
bovis: What does that include folder look like?
<adam12>
bovis: Path might be different. Get the new path from the broken gem install.
teclator has quit [Ping timeout: 252 seconds]
cahoots has joined #ruby
<adam12>
bovis: Could try 2.2.0 too. I don't actually know which version you want, but it's the one before they amalgamated headers.
<bovis>
adam12: Interesting. Uninstalling rice v4 and trying install mapnik again gives a long list of errors. https://bpa.st/BXVQK With rice v3, the include folder doesn't exist, but here's the output of 'ls -fl /usr/lib/ruby/gems/3.1.0/gems/rice-3.0.0/ruby/lib/include/rice/' http://sprunge.us/YXzk5J
<adam12>
bovis: Might still be worth going back to rice 2.2.0. Uninstall rice 3.
infinityfye has quit [Quit: Leaving]
cahoots has quit [Ping timeout: 248 seconds]
<adam12>
bovis: Actually, looking closer at that error, I bet rice is fine now but mapnik is the issue.
<adam12>
You can try going further down the rice version list, but I bet it won't change anything. How did you install mapnik?
<bovis>
adam12: Alpine has a package for mapnik.
<adam12>
bovis: Does Alpine split dev/headers? ie. mapnik-dev or similar?
cahoots has joined #ruby
<bovis>
adam12: Yes. There's a package for mapnik-dev. Hadn't thought to try that...
<bovis>
adam12: rice 2.2.0 didn't work. rice 2.2.0 with the mapnik-dev package didn't work. rice 4 with the -dev package didn't work (same error as originally)
cahoots has quit [Ping timeout: 246 seconds]
<adam12>
bovis: What's the error with rice 3? Can you paste current version? And confirm mapnik version is one supported by ruby-mapnik.
<adam12>
bovis: Outside of this, I dont have any ideas.
eikoakiba has joined #ruby
eikoakiba has left #ruby [#ruby]
<bovis>
adam12: What did you want the current version of? Error for 'install mapnik' with rice 3 is https://bpa.st/56L5M. The ruby-mapnik gem is old, circa 2015.
<bovis>
adam12: I figured the mapnik package would be updated. The initial error looked to be with rice, so I hadn't thought about interaction with the gem and mapnik.
jidar has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
cahoots has joined #ruby
jidar has quit [Quit: Remote host closed the connection]
cahoots has quit [Ping timeout: 268 seconds]
<adam12>
bovis: I suspect your new error is related to mapnik from Alpine being too new.
<bovis>
adam12: Rolling back the package will be a little bit of work. I'll make the changes later. Thanks for all the help so far.
<adam12>
bovis: cheers.
desnudopenguino has joined #ruby
teclator has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
teclator has quit [Ping timeout: 248 seconds]
ur5us has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 248 seconds]
jidar has joined #ruby
cahoots has joined #ruby
cahoots has quit [Ping timeout: 255 seconds]
teclator has joined #ruby
teclator has quit [Ping timeout: 255 seconds]
hightower3 has joined #ruby
cahoots has joined #ruby
hightower4 has quit [Ping timeout: 252 seconds]
cahoots has quit [Ping timeout: 252 seconds]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 248 seconds]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
cahoots has joined #ruby
cahoots has quit [Ping timeout: 252 seconds]
ruby[bot] has quit [Remote host closed the connection]