ruby-wasm
ruby-wasm copied to clipboard
No such file or directory - mrbc
Tried building a ruby script and got the following error:
ruby-wasm build /Users/nburns/notion/app/models/date_generator/schedule_date_generator.rb
/usr/local/lib/ruby/gems/2.3.0/gems/wasm-0.0.2/bin/ruby-wasm:40:in ``': No such file or directory - mrbc (Errno::ENOENT)
from /usr/local/lib/ruby/gems/2.3.0/gems/wasm-0.0.2/bin/ruby-wasm:40:in `build'
from /usr/local/lib/ruby/gems/2.3.0/gems/wasm-0.0.2/bin/ruby-wasm:136:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/bin/ruby-wasm:24:in `load'
from /usr/local/lib/ruby/gems/2.3.0/bin/ruby-wasm:24:in `<main>'
Ruby version: ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-darwin17]
OS: macOS 10.13.6 (17G65)
Do I need to install something else as a part of ruby-wasm?
You need to have mruby installed and available in your PATH. In his blog post corresponding to this repo, Tom recommends using this command: brew install mruby. After that, the mrbc command should be present globally in your system.
After installing mruby got another error:
/Users/sashar/sites/ruby-wasm/bin/ruby-wasm:49:in ``': No such file or directory - emcc (Errno::ENOENT)
from /Users/sashar/sites/ruby-wasm/bin/ruby-wasm:49:in `build'
from /Users/sashar/sites/ruby-wasm/bin/ruby-wasm:137:in `<top (required)>'
from /Users/sashar/.rvm/gems/ruby-2.3.5/bin/ruby-wasm:23:in `load'
from /Users/sashar/.rvm/gems/ruby-2.3.5/bin/ruby-wasm:23:in `<main>'
from /Users/sashar/.rvm/gems/ruby-2.3.5/bin/ruby_executable_hooks:15:in `eval'
from /Users/sashar/.rvm/gems/ruby-2.3.5/bin/ruby_executable_hooks:15:in `<main>'
As stated in the README, you need to have the emscripten toolchain installed and activated, as the ruby-wasm command only works by using its compiler. See http://webassembly.org/getting-started/developers-guide for information about installing the emcc command.
@sasharevzin
$ git clone https://github.com/juj/emsdk.git $ cd emsdk $ ./emsdk install latest $ ./emsdk activate latest
then add alias wasm_init="source ~/Developer/emsdk/emsdk_env.sh" to your bash profile so you can run wasm_init when you get that error.