New to Ruby? We recommend Ruby in Twenty Minutes to get up to speed.
Local development
To run the code for your challenge locally, you’ll needruby installed. Our test runners use version 3.3 (as of May 2024).
The script for your challenge (like ./spawn_redis_server.sh) will run your code using Bundler, a dependency manager which comes preinstalled with Ruby. It looks something like this:
File structure
- The files for your solution are placed in the
app/directory. app/main.rbis the entrypoint of the project.
Adding more files
You can add more files and directories toapp/. The test runner will include them when compiling your code.
For example, if you added a file at app/foo.rb, you could use it like so:
Adding dependencies
Gemfile lists your project’s dependencies. You can add dependencies by specifying the name of the gem and optionally the version.
For example, To add the nokogiri gem, add the following line to your Gemfile:
Gemfile.lock file.