Ruby

Ruby is a dynamic, reflective, object-oriented, general-purpose programming language which supports multiple programming paradigms.

featured tutorialHow To Use Array Methods in Ruby
Arrays let you represent lists of data in your programs. Once you have data in an array, you can sort it, remove dupl...

Brian Hogan • Published on October 13, 2017 · Updated on September 22, 2019

featured tutorialHow To Write Your First Ruby Program
The “Hello, World!” program is a classic and time-honored tradition in computer programming. It’s a simple and comple...

Brian Hogan • Published on June 30, 2017

featured tutorialHow To Add Stimulus to a Ruby on Rails Application
In this tutorial, you will install and use Stimulus to build on an existing Rails application that offers readers inf...

Kathleen Juell • Published on October 1, 2019

Subscribe to Ruby
Get notified when new articles on Ruby are published.
    All
  • 20 Results
    • Question

      Gem not found error when deploying monorepo to App Platform

      Hi, I am using App Platform to deploy a Ruby on Rails API backend.Rails version : 7.0.2Ruby version : 3.1.1 When I deploy my backend on App Platform both build and deploy phase are working properly. I am switching to ...
      1 answer2 months agoBy adrilefDeploymentDigitalOcean App PlatformRubyRuby on Rails
    • Tutorial

      How To Automate Ruby On Rails Application Deployments Using Capistrano

      In this tutorial, we are going create a rock-solid CentOS server to host Ruby-on-Rails applications using Nginx and Passenger. We will continue with learning how to automate the process of deployments—and updates—usin...
      2 months agoBy O.S. TezerRuby on RailsRubyCentOS
    • Tutorial

      How To Install Ruby on Rails with RVM on Ubuntu 20.04

      A popular web application framework, Ruby on Rails (often referred to as Rails) was designed to help you develop successful projects while writing less code. RVM lets you manage and work with multiple Ruby development...
      3 months agoBy Lisa Tagliaferri, Tony TranRubyRuby on RailsUbuntu 20.04
    • Question

      Rails 7, ActiveStorage and Spaces.

      I am hitting a Aws::S3::Errors::NoSuchBucket. error when attempting to upload a file via a Rails 7.0.1 app with ruby 3.1 installed. This is unexpected given the rails documentation and indications given here in a comm...
      Accepted Answer: Hi there, Have you tried specifying only the name of the space itself rather than the whole FQDN: bucket: <^>static-images-reflektor<^> Let me know how this goes.Best,Bobby
      1 answer4 months agoBy jrp780586Ruby on RailsRubyDevelopmentDigitalOcean Spaces
    • Question

      GEM ?? How To Create Nested Resources for a Ruby on Rails Application

      Thank for your article, is awesomeSome gem that make this for many models nested ?I have for my application 50 tables (Models), is very difficult for each make all you explication…many time for development sorry for m...
      No answers yet5 months agoBy jungleandseaandmountainsRuby on RailsRubyDevelopment
    • Question

      Is it possible to use Spaces in existing project?

      I have existing Rails project and want to use Spaces. I worrying about existing files uploaded on the server. Please suggest any solutions?
      1 answer7 months agoBy pavanShrimpRuby on RailsRubyDevelopmentDigitalOcean Spaces
    • Tutorial

      How To Install Ruby on Rails with rbenv on Ubuntu 20.04

      Ruby on Rails is one of the most popular application stacks for developers looking to create sites and web apps. Using rbenv will provide you with a solid environment for developing your Ruby on Rails applications as ...
      8 months agoBy Brian Hogan, Lisa Tagliaferri, Jeanelle HorcasitasRubyRuby on RailsUbuntuUbuntu 20.04
    • Tutorial

      How To Use ActiveStorage in Rails 6 with DigitalOcean Spaces

      Save images to DigitalOcean Spaces with Rails 6 and Active Storage
      9 months agoBy Nik WakelinDigitalOcean SpacesRuby on RailsDevelopmentRuby
    • Question

      i have created database and tables in postgres pgadmin want to connect to my new rails app

      i have created database and tables in postgres want to connect to my new rails app. Also after connecting it how can i run migrations or show all data that was in those tables in rails console. like User.all()
      1 answer11 months agoBy parthtanna1234Ruby on RailsPostgreSQLRubyUbuntu
    • Question

      Moving a project from Droplet to Apps (with existing db and uploaded image files)

      Hi, I have a RubyonRails website running on Droplet for a few years now. I have a vast poster db and image files. It is deployed from Github via mina deploy. I’m not very technical person when it comes to server setup...
      1 answer1 year agoBy O YRubyRuby on RailsDigitalOcean DropletsDigitalOcean 1-Click Apps MarketplacePostgreSQLGitHub Actions
    • Question

      How to get into Rails console on App Platform

      I have a Rails app deployed to Digitalocean App Platform but I cannot see a way to access to the rails console. If I go to “Console” on the web page and execute the console command the output is an error: integer 2558...
      2 answers1 year agoBy beydoganRuby on RailsRubyDigitalOcean App Platform
    • Question

      Object to Array conversion

      Received data from external system in Object format. Due to this not able to read the content in a tool. To read the content need to convert into Array format. How to convert object into Array ? Sample content: { head...
      1 answer1 year agoBy bnrinboxRubyDevelopment
    • Question

      Docker Image Cache When using an older ruby 1.9.3

      When building Dockerfile from an older version of ruby I’m getting a docker-cache error, see my Dockerfile to reproduce this error. FROM ruby:1.9.3-p551 # Create app directory RUN mkdir -p /app WORKDIR /app ENV RAILS_...
      2 answers1 year agoBy manpreetnarangDigitalOcean App PlatformRubyRuby on Rails
    • Tutorial

      How To Use IRB to Explore Ruby

      IRB, short for Interactive Ruby, is a REPL (read-eval-print loop) which serves as a quick way to explore the Ruby programming language and try out code without creating a file. In this tutorial, you’ll use IRB to run ...
      1 year agoBy Brian HoganRubyDevelopment
    • Book

      Rails on Containers eBook

      Download the Complete eBook! Rails on Containers eBook in EPUB format Rails on Containers eBook in PDF format
      1 year agoBy Kathleen JuellRuby on RailsRubyKubernetesContainerDevelopmentBooks
    • Question

      Wrong time for some seconds after reboot

      We have a Ruby application that uses Time.now in order to get the current time (and sign some requests that are time-sensitive). Every time that we reboot the droplet (Ubuntu 18.04 LTS) the time returned is completely...
      2 answers1 year agoBy Marco ColliUbuntuRubyRuby on Rails
    • Question

      Rails Puma silently crashes without error

      I have a Ruby on Rails application deployed in DigitalOcean ubuntu image. My versions are: ruby 2.6.0 rails 5.1.5.rc1 puma 4.3.6 I deploy my application using Capistrano deploy.rb # config valid for current version an...
      No answers yet1 year agoBy allenchunRuby on RailsRubyUbuntu
    • Question

      Speed Up App Deployments

      I’m using the new Apps features with a Ruby on Rails 6 application. Deployments are taking 10-20 minutes (sometimes 30 minutes) when they were taking about 1-2 minutes on Heroku (it’s a big application). Right now dur...
      4 answers2 years agoBy brodyhoskinsRuby on RailsRubyDigitalOcean App PlatformNeeds Product Answer
    • Question

      how to add an instance method to Array class in ruby

      After adding an instance method to Array class in a Ruby module, it is not found as an instance method when called!
      1 answer2 years agoBy wqzrp24Ruby
    • Tutorial

      How To Set Up a Ruby on Rails GraphQL API

      In this tutorial, you will build a GraphQL-powered Ruby on Rails API for taking notes. When you are finished, you will be able to create and view notes from the API using GraphQL.
      2 years agoBy Chuks OpiaRuby on RailsRubyGraphQLPostgreSQLAPI