22
33![ Ruby 3.1 | 3.2 | 3.3] ( https://img.shields.io/badge/ruby-3.1%20%7C%203.2%20%7C%203.3-blue.svg?style=for-the-badge )
44[ ![ MIT] ( https://img.shields.io/github/license/temporalio/sdk-ruby.svg?style=for-the-badge )] ( LICENSE )
5- <!-- TODO: [](https://rubygems.org/gems/temporalio) -->
5+ [ ![ Gem] ( https://img.shields.io/gem/v/temporalio?style=for-the-badge )] ( https://rubygems.org/gems/temporalio )
66
77[ Temporal] ( https://temporal.io/ ) is a distributed, scalable, durable, and highly available orchestration engine used to
88execute asynchronous, long-running business logic in a scalable and resilient way.
99
1010** Temporal Ruby SDK** is the framework for authoring workflows and activities using the Ruby programming language.
1111
12+ Also see:
13+
14+ * [ Ruby Samples] ( https://github.com/temporalio/samples-ruby )
15+ * [ API Documentation] ( https://rubydoc.info/gems/temporalio/0.2.0 )
16+
1217⚠️ UNDER ACTIVE DEVELOPMENT
1318
1419This SDK is under active development and has not released a stable version yet. APIs may change in incompatible ways
@@ -49,6 +54,7 @@ Notably missing from this SDK:
4954 - [ Platform Support] ( #platform-support )
5055- [ Development] ( #development )
5156 - [ Build] ( #build )
57+ - [ Build Platform-specific Gem] ( #build-platform-specific-gem )
5258 - [ Testing] ( #testing )
5359 - [ Code Formatting and Type Checking] ( #code-formatting-and-type-checking )
5460 - [ Proto Generation] ( #proto-generation )
@@ -59,26 +65,26 @@ Notably missing from this SDK:
5965
6066### Installation
6167
62- Install the gem to the desired version as mentioned at https://rubygems.org/gems/temporalio . Since the SDK is still in
63- pre-release, the version should be specified explicitly. So either in a Gemfile like:
68+ Can require in a Gemfile like:
6469
6570```
66- gem 'temporalio', '<version>'
71+ gem 'temporalio'
6772```
6873
6974Or via ` gem install ` like:
7075
7176```
72- gem install temporalio -v '<version>'
77+ gem install temporalio
7378```
7479
80+ ** NOTE** : Only macOS ARM/x64 and Linux ARM/x64 are supported, and the platform-specific gem chosen is based on when the
81+ gem/bundle install is performed. A source gem is published but cannot be used directly and will fail to build if tried.
82+ MinGW-based Windows and Linux MUSL do not have gems. See the [ Platform Support] ( #platform-support ) section for more
83+ information.
84+
7585** NOTE** : Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and ` async ` gem) are only
7686supported on Ruby versions 3.3 and newer.
7787
78- ** NOTE** : MinGW-based Windows is not currently supported natively, but is via WSL. Prebuilt gems for Linux MUSL are also
79- not currently present. We also do not publish a gem for building from source at this time. See the
80- [ Platform Support] ( #platform-support ) section later for more information.
81-
8288### Implementing an Activity
8389
8490Implementing workflows is not yet supported in the Ruby SDK, but implementing activities is.
@@ -462,9 +468,9 @@ This means Linux and macOS for ARM and x64 have published gems. Currently, a gem
462468Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/172 ) with Windows and multi-threaded Rust, MinGW-based
463469Windows (i.e. ` x64-mingw-ucrt ` ) is not supported. But WSL is supported using the normal Linux gem.
464470
465- At this time a pure source gem is not published, which means that when trying to install the gem on an unsupported
466- platform, you may get an error that it is not available. Building from source requires many files across submodules and
467- requires Rust to be installed. See the [ Build ] ( #build ) section for how to build a gem from the repository.
471+ At this time a pure source gem is published for documentation reasons, but it cannot be built and will fail if tried.
472+ Building from source requires many files across submodules and requires Rust to be installed. See the [ Build ] ( #build )
473+ section for how to build a the repository.
468474
469475The SDK works on Ruby 3.1+, but due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and
470476` async ` gem) are only supported on Ruby versions 3.3 and newer.
@@ -488,13 +494,32 @@ To build shared library for development use:
488494
489495 bundle exec rake compile
490496
491- Note, this is not ` compile:dev ` because debug-mode in Rust has
497+ ** NOTE** : This will make the current directory usable for the current Ruby version by putting the shared library
498+ ` lib/temporalio/internal/bridge/temporalio_bridge.<ext> ` in the proper place. But this development shared library may
499+ not work for other Ruby versions or other OS/arch combinations. For that, see "Build Platform-specific Gem" below.
500+
501+ ** NOTE** : This is not ` compile:dev ` because debug-mode in Rust has
492502[ an issue] ( https://github.com/rust-lang/rust/issues/34283 ) that causes runtime stack size problems.
493503
494- To lint, build, and test release :
504+ To lint, build, and test:
495505
496506 bundle exec rake
497507
508+ #### Build Platform-specific Gem
509+
510+ The standard ` bundle exec rake build ` will produce a gem in the ` pkg ` directory, but that gem will not be usable because
511+ the shared library is not present (neither the Rust code nor the compiled form). To create a platform-specific gem that
512+ can be used, ` rb-sys-dock ` must be run. See the
513+ [ Cross-Compilation documentation] ( https://oxidize-rb.github.io/rb-sys/tutorial/publishing/cross-compilation.html ) in the
514+ ` rb-sys ` repository. For example, running:
515+
516+ bundle exec rb-sys-dock --platform x86_64-linux --ruby-versions 3.2,3.3 --build
517+
518+ Will create a ` pkg/temporalio-<version>-x86_64-linux.gem ` file that can be used in x64 Linux environments on both Ruby
519+ 3.2 and Ruby 3.3 because it contains the shared libraries. For this specific example, the shared libraries are inside
520+ the gem at ` lib/temporalio/internal/bridge/3.2/temporalio_bridge.so ` and
521+ ` lib/temporalio/internal/bridge/3.3/temporalio_bridge.so ` .
522+
498523### Testing
499524
500525This project uses ` minitest ` . To test:
0 commit comments