⚡️
Fast Development
Leverage Vite's instant server start and Hot Module Replacement for a seamless development experience.
Write Ruby code and run it in the browser with Vite's lightning-fast development experience

# Install the Vite plugin
pnpm add -D vite-plugin-opal
# Install the Ruby gem
gem install opal-vitegem 'opal'
gem 'opal-vite'import { defineConfig } from 'vite'
import opal from 'vite-plugin-opal'
export default defineConfig({
plugins: [
opal({
loadPaths: ['./app/opal'],
sourceMap: true
})
]
})# app/opal/application.rb
puts "Hello from Ruby!"
class Greeter
def initialize(name)
@name = name
end
def greet
puts "Hello, #{@name}!"
end
end
Greeter.new("World").greetTry opal-vite with live demo applications:
See all demos on the Playground page.