{"id":18728832,"url":"https://github.com/rubyonworld/ios-ruby-embedded","last_synced_at":"2026-05-01T06:33:46.809Z","repository":{"id":174007964,"uuid":"542157721","full_name":"RubyOnWorld/ios-ruby-embedded","owner":"RubyOnWorld","description":"This is a project that will build the current mruby source into a XCode framework. That framework can then be used to embed Ruby into an iOS application.","archived":false,"fork":false,"pushed_at":"2022-09-27T17:39:02.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:33:05.115Z","etag":null,"topics":["app","application","framework","ios","mruby","ruby","xcode"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-27T15:28:26.000Z","updated_at":"2022-09-27T17:47:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e38cf24-2ebe-469b-b152-2e2a89853ebb","html_url":"https://github.com/RubyOnWorld/ios-ruby-embedded","commit_stats":null,"previous_names":["rubyonworld/ios-ruby-embedded"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/ios-ruby-embedded","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fios-ruby-embedded","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fios-ruby-embedded/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fios-ruby-embedded/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fios-ruby-embedded/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/ios-ruby-embedded/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fios-ruby-embedded/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32487532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","application","framework","ios","mruby","ruby","xcode"],"created_at":"2024-11-07T14:24:29.396Z","updated_at":"2026-05-01T06:33:46.790Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\n\nThis is a project that will build the current mruby source into a XCode\nframework. That framework can then be used to embed Ruby into an iOS\napplication.\n\nFor a complete example of using the product of the build check out\n[MRubyiOSExample](https://github.com/carsonmcdonald/MRubyiOSExample)\n\nThis is not an attempt to make a bridge between Objective-C and Ruby, if you\nwant that then check out the [mobiruby](http://mobiruby.org/) project.\n\n## Build\n\n* git clone git://github.com/carsonmcdonald/ios-ruby-embedded.git\n* cd ios-ruby-embedded\n* git submodule init\n* git submodule update\n* rake\n\nAfter the above steps you should have a complete MRuby.framework framework\nstructure that is ready to use.\n\n## Install\n\nTo install the framework in an XCode project follow these steps (these steps\nassume XCode 5.0.x):\n\n* Select the top of the project on the left hand project display\n* Select the \"Build Phases\" tab in the project details\n* Click the + button under the \"Link Binary With Libraries\" dropdown\n* Select \"Add Other...\" from the framework add popup\n* Navigate to the MRuby.framework direcotry in the file browser and click\n  \"Open\"\n\n## Example Use\n\nAssume you have the following simple Ruby script you want to execute:\n\n```\nputs \"Hello world\"\n```\n\nFirst you need to compile the script into byte code using the mrbc command\nthat can be found in the bin directory after you have compiled the project:\n\n```\nmrbc helloworld.rb\n```\n\nThe output of that command is a bytecode file that can be run using the mruby\ncommand found in the same bin directory. NB you currently need to cat all your\nscript files together before compiling the, using require doesn't work.\n\nOnce you have compiled your Ruby code and added it to your application bundle\nyou can embed it in your app using something like the following code:\n\n```\n#include \"mruby/mruby.h\"\n#include \"mruby/mruby/proc.h\"\n#include \"mruby/mruby/dump.h\"\n\n// ...\n\n    NSString *bcfile = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@\"helloworld.mrb\"];\n    \n    mrb_state *mrb = mrb_open();    \n    FILE *fp = fopen([bcfile UTF8String], \"rb\");\n    if (fp == NULL) {\n        NSLog(@\"Error loading file...\");\n    } else {\n        int n = mrb_read_irep_file(mrb, fp);\n        fclose(fp);\n        \n        mrb_run(mrb, mrb_proc_new(mrb, mrb-\u003eirep[n]), mrb_top_self(mrb));\n    }\n```\n\n## Notes\n\n* mruby is new and changing constantly, don't be surprised if this project\n  doesn't build.\n* Currently you can't use the mruby compiler while embedded in an arm7 device.\n  That is why you need to pre-compile the code using mrbc. It will work on the \n  simulator but don't let that fool you into thinking it will work on a device. \n  An app created to compile code would almost certainly have other issues.\n\n## License\n\nMIT to match the mruby license. See the LICENSE file for full license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fios-ruby-embedded","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fios-ruby-embedded","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fios-ruby-embedded/lists"}