Build Ruby files to WebAssembly with mruby. This repo contains the compile toolchain for ruby to wasm, with docker.
cd docker-machine
docker build -t awin/emcc-mruby .
cd intro
docker run \
--rm \
-v $(pwd):/src \
-u emscripten \
awin/emcc-mruby \
ruby_wasm build hello.rb
This should generate app.js
and app.wasm
in the intro directory.
cd intro
ruby server.rb
And open http://localhost:8000 in the browser. In developer tools console, you should find the console statement
- Tom Black for the Ruby on WebAssembly article, and the wasm gem.
- Piotr Paczkowski for the base docker image (github repo)