Ruby: Developing in Ruby: the local approach
This documentation is part of the Development Platform guide. You can view the complete guide here: Prepare your development platform to be pleasant and efficient.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Ruby cloud solution that provides a host of benefits, including:
- Deploy your application in seconds with a simple
git push.- Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
- Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
- Get optimal performance and robust security thanks to a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!
Setting up a local development environment involves installing Ruby, its dependencies, and the necessary tools on your computer.
Keep in mind that local development might be limited by hardware constraints and requires manual updates and backups.
Setting up your local Ruby environment
To start developing with Ruby on your local machine, you must install Ruby and its accompanying dependencies.
We will use asdf, a versatile tool that allows you to manage multiple programming environments and effortlessly switch between versions on a per-project basis.
Although the asdf tool may initially seem unfamiliar, it can greatly simplify your Ruby development experience by saving time and preventing issues associated with managing multiple environments.
In addition to Ruby, asdf works with many other languages such as Node.js, Python, and PHP, making it a valuable tool in your development toolkit.
Installing asdf
To install asdf, follow the steps outlined in the official documentation.
After installation, verify that asdf is functioning as expected by running:
asdf version
If the installed version appears, asdf is ready for use.
Installing Ruby using asdf
To install the latest version of Ruby using asdf, execute the following commands:
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby latest
asdf global ruby latest
After installation, confirm that Ruby works correctly by checking its version with:
ruby --version
This should return the Ruby version, indicating that it is properly installed and ready to use.