Skip to content

Instantly share code, notes, and snippets.

@designfrontier
Created June 2, 2016 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save designfrontier/919df59e6739246ca8ad3bcd7181d54f to your computer and use it in GitHub Desktop.
Save designfrontier/919df59e6739246ca8ad3bcd7181d54f to your computer and use it in GitHub Desktop.
writeln("setting up server...")
server := HttpServer clone do(
setPort(8090)
renderResponse := method(request, response,
list("path", "uri", "body") foreach(k,
v := request perform(k)
response body appendSeq(k .. ": " .. v .. "<br>")
)
response body appendSeq("<hr>")
request headers keys sort foreach(k,
v := request headers at(k)
response body appendSeq(k .. ": " .. v .. "<br>")
)
)
)
writeln("starting server...")
server start
@designfrontier
Copy link
Author

and the error when running this:

➟ io web.io 
setting up server...

  Exception: Error loading object '/usr/local/lib/io/addons/Socket/_build/dll/libIoSocket.dylib': 'dlopen(/usr/local/lib/io/addons/Socket/_build/dll/libIoSocket.dylib, 10): Library not loaded: /usr/local/lib/libevent-2.0.5.dylib
  Referenced from: /usr/local/lib/io/addons/Socket/_build/dll/libIoSocket.dylib
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libevent-2.0.5.dylib: mach-o, but wrong architecture
    /usr/local/lib/libevent-2.0.5.dylib: mach-o, but wrong architecture'
  ---------
  open                                AddonLoader.io 71
  Object Server                        HttpServer.io 1
  Addon load                           AddonLoader.io 124
  AddonLoader loadAddonNamed           Z_Importer.io 97
  FolderImporter import                Z_Importer.io 125
  List detect                          Z_Importer.io 125
  true and                             Z_Importer.io 125
  Object HttpServer                    web.io 4
  Importer import                      Z_Importer.io 138
  CLI doFile                           Z_CLI.io 140
  CLI run                              IoState_runCLI() 1

@stevedekorte
Copy link

I'm not seeing this problem on my side. Have you tried installing the binary build?

@designfrontier
Copy link
Author

@stevedekorte yeah :-( may just need to wipe it out and try again.

@designfrontier
Copy link
Author

@stevedekorte I've tried uninstalling, installing on a clean system, building from source... nothing. Same error every time. Any thoughts on what I could try?

@designfrontier
Copy link
Author

For anyone finding this in the future... got it working by spinning it up in a docker container. This one to be specific: https://hub.docker.com/r/nacyot/io-io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment