2

So I feel incredibly frustrated. I am doing www.railstutorial.org and they require a very specific version of rails (4.2.2). I have installed it as they wanted. Put in their Gemfile specs on their "hello_app" app they provided. When I run "rails server" I get an error message saying that "byebug" is erroring. I try to install earlier and later versions of bye bug and I get the same error message. Can someone please help me? I feel pretty lost.

The tutorial is at the url below.

https://www.railstutorial.org/book/beginning#code-hello_action

 alopex@alopex-TH55-HD:~/workspace/hello_app$ more Gemfile
 source 'https://rubygems.org

 gem 'rails',                '4.2.2'
 gem 'sass-rails',           '5.0.2'
 gem 'uglifier',             '2.5.3'
 gem 'coffee-rails',         '4.1.0'
 gem 'jquery-rails',         '4.0.3'
 gem 'turbolinks',           '2.3.0'
 gem 'jbuilder',             '2.2.3'
 gem 'sdoc',                 '0.4.0', group: :doc

group :development, :test do
 gem 'sqlite3',     '1.3.9'
 gem 'byebug',      '3.4.0'
 gem 'web-console', '2.0.0.beta3'
 gem 'spring',      '1.1.3'
end

alopex@alopex-TH55-HD:~/workspace/hello_app$ bundle install

 Gem::InstallError: byebug requires Ruby version >= 2.0.0.
 An error occurred while installing byebug (3.4.0), and Bundler cannot  continue.
 Make sure that `gem install byebug -v '3.4.0'` succeeds before bundling.

 alopex@alopex-TH55-HD:~/workspace/hello_app$ sudo gem install byebug -v 3.4.0
 ERROR:  Error installing byebug:
 byebug requires Ruby version >= 2.0.0.
Erik Aasland
  • 167
  • 1
  • 11

2 Answers2

2

I fixed this problem in this way:

  • Open your application's Gemfile
  • remove: gem 'byebug'
  • replace it with: gem 'pry-byebug', platform: [:ruby_20]
AndreaM16
  • 3,917
  • 4
  • 35
  • 74
1

It isn't rails issue: byebug requires Ruby version to be 2.0 at least. You can check your Ruby version with ruby -v, I guess it is 1.9.3 in your case. You can use rvm to install actual Ruby version on your system.

Also, you can try to remove byebug from Gemfile and try to run bundle again. Maybe other gems can run with ruby 1.9.3, and you can learn rails without dealing with rvm.

hedgesky
  • 3,271
  • 1
  • 21
  • 36