Ruby: Development platform
Set up your development environment for a smooth and efficient workflow
👋 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, dedicated infrastructure.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!
A well-prepared development platform makes your work faster, more enjoyable, and more reliable.
Developing in Ruby: local setup
A local Ruby environment gives you full control, but requires a few extra steps. You install Ruby, dependencies, and tools yourself.
Installing Ruby with asdf
asdf is a flexible version manager for multiple languages including Ruby, Node.js, Python, and PHP. It makes it easy to keep projects on different versions and prevents conflicts between tools.
To get started, install asdf by following the official installation guide.
Once installed, you can verify asdf is working by running:
asdf version
If you see a version number, asdf is set up correctly.
To install the latest Ruby version:
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby latest
asdf global ruby latest
Check Ruby is working:
ruby --version
This confirms Ruby is ready for use.
Creating a Ruby project
Once Ruby is installed:
asdf install ruby latest \
&& asdf global ruby latest
Install Rails:
gem install rails
Create your app (replace my_app with your project name):
rails new my_app
cd my_app
asdf local ruby latest
Start the Rails server:
bin/rails server
Ruby on Rails welcome screen
These steps give you a clean starting point for your project, and asdf ensures you always use the right Ruby version.
By default, Rails creates a local Git repository for your project, but it is not connected to any remote hosting service.
For reliable version control and backups, you can connect your repository to a service like GitHub, GitLab, or Bitbucket. Stackhero offers a GitLab cloud service that runs on dedicated infrastructure, giving you privacy and security in Europe or the USA.