How to Run Ruby on Rails with Ruby 1.9X

Is it possible to run Ruby on Rails with Ruby 1.9x?

Rails does work in 1.9 as of 2.3. I suppose they still recommend Ruby 1.8.7 because it has the most compatibility with other Ruby libraries — a lot of them are still catching up.

How can I run a Rails 1.2.5 application on ruby 1.9?

There was quite a few patches to Rails to make it run under Ruby 1.9. I think you are up for a challenge if you try to do that. With Ruby Version Manager you can work with multiple ruby environments from interpreters to sets of gems.

Ruby 1.9.2 and Rails 3 cannot open rails console

Apparently ubuntu and ruby don't always catch dependencies like they should.

From the first google hit (yeah, I clicked on this stack-overflow in place #2 before checking out the first result.)

Navigate to the Ruby source and enter:

sudo apt-get install libreadline5-dev
cd ext/readline
ruby extconf.rb
make
sudo make install

So, if you're on another distro, make sure you install readline somehow (source/package), then run make/install on extconf from the source. I tried what gkaykck suggested of course but got this without readline already on my system.

$ ruby extconf.rb
checking for tgetnum() in -lncurses... no
checking for tgetnum() in -ltermcap... no
checking for tgetnum() in -lcurses... no
checking for readline/readline.h... no
checking for editline/readline.h... no

Starting with Ruby 1.9.x, Rails 3, and/or Merb

Rails3 is moving really fast. Updates from books or blog entry is not sufficient enough to keep up with the changes that is happening in Rails3. So I would suggest follow Rails in Github instead, although it might seem scary but I found it much more effective.

Controlling ruby version used in Rails

https://rvm.io/rvm/install

Install RVM using these instructions, then you can manage and switch between different Ruby versions and gemsets very easily. Using RVM you can have both 1.8.7 and 1.9.x (or any other version) on your system without having to constantly manually change your path and ruby alias.

Older versions of RVM used the .rvmrc file to automatically switch the ruby within a directory. Newer versions use the .ruby-version file.

To switch between rubies, just type rvm use 2.0.0 or whatever version it is you want to use. For ongoing projects it's a good idea to add the .ruby-version file in the root of the directory that contains the version string you want to use, i.e.

2.0.0

how to convert Ruby application 1.8.7 to 1.9.2

Hope this tutorial is helpful to start working on upgrading your application to Ruby-1.9.3

He explained nicely how to upgrade from Ruby-1.8.7 to Ruby-1.9.3

Debugging in ruby 1.9

Note: this answer was correct but is now out of date. See the below correct answer. TL;DR: use 'debugger' now.

ruby-debug is now available with Ruby 1.9.x. See http://www.github.com/mark-moseley

To install (using gem on 1.9 Ruby installation):

gem install ruby-debug19

(with perhaps the necessary 'sudo' in front of it).

Which Ruby on Rails is compatible with which Ruby version?

This is an old question, but the fact that rails is tested against a version of ruby is a good indication that it should work on that version of ruby.

Since 9th April 2019, stable branches of Rails use Buildkite for automated testing, and the list of tested ruby versions, by rails branch, is:

Rails 6.1

  • >= 2.5.0

Rails 6.0

  • >= 2.5.0

Rails 5.2

  • >= 2.2.2
  • < 2.7 (see https://github.com/rails/rails/issues/38426)

Rails 5.1

  • >= 2.2.2

Rails 5.0

  • >= 2.2.2

Rails 4.2

  • >= 1.9.3

Rails 4.1

  • >= 1.9.3

Prior to 9th April 2019, stable branches of Rails since 3.0 use travis-ci for automated testing, and the list of tested ruby versions, by rails branch, is:

Rails 3.0

  • 1.8.7
  • 1.9.2
  • 1.9.3

Rails 3.1

  • 1.8.7
  • 1.9.2
  • 1.9.3

Rails 3.2

  • 1.8.7
  • 1.9.2
  • 1.9.3
  • 2.0.0
  • 2.1.8
  • 2.2.6
  • 2.3.3

Rails 4.0

  • 1.9.3
  • 2.0.0
  • 2.1
  • 2.2

Rails 4.1

  • 1.9.3
  • 2.0.0
  • 2.1
  • 2.2.4
  • 2.3.0

Rails 4.2

  • 1.9.3
  • 2.0.0-p648
  • 2.1.10
  • 2.2.10
  • 2.3.8
  • 2.4.5

Rails 5.0

  • 2.2.10
  • 2.3.8
  • 2.4.5

Rails 5.1

  • 2.2.10
  • 2.3.7
  • 2.4.4
  • 2.5.1

Rails 5.2

  • 2.2.10
  • 2.3.7
  • 2.4.4
  • 2.5.1

Rails 6.0

  • 2.5.3
  • 2.6.0

(From https://www.hmallett.co.uk/2018/08/ruby-and-ruby-on-rails-version-compatibility/)



Related Topics



Leave a reply



Submit