Learn how to solve CodeCrafters challenges in Ruby
ruby
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:
app/
directory.app/main.rb
is the entrypoint of the project.app/
. 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:
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.