fermyon / developer

This is the home for developer.fermyon.com
https://developer.fermyon.com
Apache License 2.0
53 stars 69 forks source link

Wasm Languages Guide: Ruby example error #1186

Open vdice opened 1 year ago

vdice commented 1 year ago

When testing the Ruby example recently (https://github.com/fermyon/wasm-languages/pull/42), I discovered that it errored out when using spin v0.6.0+. Let's pinpoint the issue and fix.

Sample output:

$ spin --version
spin 0.6.0 (12a5037 2022-10-21)

$ spin up
Serving http://127.0.0.1:3000
Available Routes:
  ruby: http://127.0.0.1:3000
2022-11-28T22:00:44.733042Z ERROR spin_http: Error processing request: Exited with i32 exit status 1
wasm backtrace:
    0: 0x6649a8 - <unknown>!<wasm function 6509>
vdice commented 8 months ago

Checked again with Spin v2.2... although spin up executes fine, I encounter the following error when I curl localhost:3000:

$ spin up
Logging component stdio to ".spin/logs/"

Serving http://127.0.0.1:3000
Available Routes:
  ruby: http://127.0.0.1:3000
/: Operation not permitted -- /lib/hello.rb (LoadError)
2024-02-22T17:00:04.584946Z ERROR spin_trigger_http: Error processing request: invoking _start for component ruby

Caused by:
    0: error while executing at wasm backtrace:
           0: 0xac3771 - <unknown>!__wasi_proc_exit
           1: 0x9462 - <unknown>!_start
       note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information
    1: Exited with i32 exit status 1
mijho commented 7 months ago

There's an open PR here https://github.com/fermyon/wagi-ruby/pull/4/files that resolves this issue

https://github.com/fermyon/developer/assets/30983976/806cc171-ee44-4818-a245-9639a90646f5