Instantly share code, notes, and snippets.

View prepare-and-start.txt
入れるのが大変なGemは入れない:
$ curl -o - https://gist.githubusercontent.com/zunda/c5f50abc1a2139d0edc1a3e6ddae2c84/raw/2a825d75fa64e5986abf685a091fc9c3ee3bdedf/run-mastodon-on-macos.patch | patch
PostgreSQLを走らせておいて、
$ export RAILS_ENV=development
$ bundle install --path=vendor/bundle
$ bundle exec rake assets:precompile
$ bundle exec rake db:drop
View rails-db-setup-backtrace.without-bootsnap.txt
/home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/lib/ffi/library.rb:275: [BUG] Segmentation fault at 0x0000005500000020
ruby 2.5.3p105 (2018-10-18 revision 65156) [aarch64-linux]
-- Control frame information -----------------------------------------------
c:0112 p:---- s:0583 e:000582 CFUNC :attach
c:0111 p:0255 s:0577 e:000576 METHOD /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/lib/ffi/library.rb:275
c:0110 p:0064 s:0557 E:001af0 CLASS /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb:
c:0109 p:0007 s:0554 E:001b60 CLASS /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb:
c:0108 p:0014 s:0551 E:002420 TOP /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb: [FINISH]
c:0107 p:---- s:0
View rails-db-setup-backtrace.txt
/home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/lib/ffi/library.rb:275: [BUG] Segmentation fault at 0x0000005500000020
ruby 2.5.3p105 (2018-10-18 revision 65156) [aarch64-linux]
-- Control frame information -----------------------------------------------
c:0134 p:---- s:0709 e:000708 CFUNC :attach
c:0133 p:0255 s:0703 e:000702 METHOD /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/ffi-1.9.25/lib/ffi/library.rb:275
c:0132 p:0064 s:0683 E:001920 CLASS /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb:
c:0131 p:0007 s:0680 E:001990 CLASS /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb:
c:0130 p:0014 s:0677 E:001f10 TOP /home/zunda/src/github.com/zunda/rails-dbmigrate-test/vendor/bundle/ruby/2.5.0/gems/rb-inotify-0.9.10/lib/rb-inotify/native.rb: [FINISH]
c:0129 p:---- s:0
View 01-heroku-18-without-libssl-dev.txt
$ ldd vendor/bundle/ruby/2.5.0/gems/puma-3.11.4/lib/puma/puma_http11.so
linux-vdso.so.1 (0x00007ffca71e9000)
libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f6c86954000)
libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f6c864dc000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6c862bd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6c85ecc000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6c85cc8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6c86dc8000)
View puma-segv.txt
[134] Puma starting in cluster mode...
[134] * Version 3.11.4 (ruby 2.5.1-p57), codename: Love Song
[134] * Min threads: 5, max threads: 5
[134] * Environment: production
[134] * Process workers: 1
[134] * Preloading application
Default type scope order, limit and offset are ignored and will be nullified
Creating scope :cache_ids. Overwriting existing method Notification.cache_ids.
[134] * Listening on tcp://0.0.0.0:8080
[134] ! WARNING: Detected 1 Thread(s) started in app boot:
View master-master.sh
#!/bin/sh
set -e
run () {
echo \$ "$*"
eval "$*"
}
confirm () {
echo
View rails-on-ruby260p2.sh
$ rbenv local 2.6.0-preview2
$ cat <<_END > Gemfile
source 'https://rubygems.org'
gem 'rails'
_END
$ bundle install --path=vendor/bundle
$ bundle exec rails new .
$ bundle exec rails s
$ mv config/application.rb config/application.rb.orig
$ cp config/application.rb.orig config/application.rb
View main.go
package main
import (
"fmt"
"math"
)
func main() {
x := 1.0 - math.Pow(2.0, -52)
y := math.Cbrt(x)
View game-of-life.rb
#!/usr/bin/ruby
class Board
Alive = '🥓'
Dead = '🥚'
Neighbors = [[-1,-1], [0,-1], [1,-1], [-1,0], [1,0], [-1,1], [0,1], [1,1]]
Glider = <<_END
🥚🥓🥚
🥚🥚🥓
View 00-build-log.txt
$ ruby23 --version
ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-netbsd]
$ bundle23 install --path=vendor/bundle
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 1.16.1
Fetching ffi 1.9.23
Installing ffi 1.9.23 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.