Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Ruby on Rails 3.2 on Red Hat Enterprise Linux 6 with Software Collections

January 31, 2013
Bohuslav Kabrda
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    While Red Hat Enterprise Linux is known for its stability and flexibility, you might not think of it first when looking for the latest version of your web application framework. If you're a developer working with Ruby and Ruby on Rails, you probably want to take advantage of their new features. Sure, you can use RVM, but sometimes you just want to get supported system packages.

    Software Collections (often abbreviated as SCL) allows you to run more recent versions of software than what ships with your current version of Red Hat Enterprise Linux. This article will show you how to start development of a Rails 3.2 application running on Ruby 1.9.3 - all on RHEL 6, using only RPM packages, alongside your default Ruby installation. This tutorial assumes that you are familiar with Ruby on Rails basics, such as creating a new application and using bundler. It is also beneficial (although not necessary) to understand how Software Collections work in general.

    Installing the ruby193 Collection

    Throughout this tutorial, we will be using the ruby193 SCL. To get started, we will need to add it to Yum repositories. Grab a copy of the repofile and put it in /etc/yum.repos.d/

    Now you can install all the packages needed for creating a Rails 3.2 application just by running (with proper privileges, of course)

    yum install ruby193
    

    While this takes some time, you'll have all the packages that you need for this exercise.

    Kickstarting a New Application

    Now that the collection is installed, you can create a new Rails application. It is important to note that all Ruby-related commands must be run in the SCL enabled environment. Otherwise they will not work or may trigger unexpected behavior.

    You can run Ruby-related commands in the SCL enabled environment in two ways.

    1. Run every command in SCL enabled environment like this:

    scl enable ruby193 "ruby -v"

    2. Run a subshell (more convenient and comfortable) that will be SCL enabled itself:

    scl enable ruby193 "bash"

    In this subshell, you can run any command as you normally would without having to remember to use "scl enable" for every command. Don't forget to enable the SCL every time you run anything that needs Ruby (e.g. rspec, minitest, rails, ...).

    To create a new application called "app", you need to issue the command:

    rails new app

    This will create a standard Rails 3.2 application with one small change in the way that Bundler is run.

    Bundler Trouble

    Normally, when creating a new Rails application, the generator calls "bundle install", which results in installing the newest versions of all Gems; this would render the SCL packaged Gems useless, as most of them would be rendered obsolete by newer versions and not be used. If you are choosing the collection for development, you probably don't want that. The default generator has been altered to run "bundle install --local", which utilizes the newest local versions of Gems (the ones from the collection). If you don't like this setup, you can always delete app/Gemfile.lock and run "bundle install" in the app directory to get the newest versions.

    Generally, if you want to start using a new Gem that is part of the collection (run "yum list 'ruby193-*'" to see the complete list, not all are installed by default), you have to

    • install it with Yum ("yum install ruby193-rubygem-foo")
    • add it to Gemfile
    • run "bundle install --local".

    If you want to use a classic Gem from rubygems.org,  you only need to add it to Gemfile and run "bundle install".

    Running the Application

    Now that the application is created, you can try to run it. Use:

    cd app
    rails s
    

    You will get an error message containing this string:

    Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
    

    Why? Rails developers have made a decision not to assume what JavaScript engine you want to use. There are number of these: therubyracer, therubyrhino, NodeJS... The ruby193 collection contains therubyracer, so we will use it (it gets installed with the collection, so you don't need to install it separately). Open Gemfile in your favorite text editor and uncomment the line that reads:

    # gem 'therubyracer', :platforms => 'ruby'
    

    Next run "bundle install --local" again. Now try running the development server again:

    rails s

    Success! You can now go to http://0.0.0.0:3000/ to see the title page of your new Ruby on Rails 3.2 application on RHEL 6. Everything is set, so you can start coding just as you are used to.

    Last updated: November 2, 2023

    Recent Posts

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.