Error while installing rack

14,481

Solution 1

[vagrant@centos65 puppet]$ sudo gem install rack passenger  
ERROR:  Error installing rack:

rack requires Ruby version >= 2.2.2.

ERROR:  Error installing passenger:

rake requires Ruby version >= 1.9.3

.

When I was trying to install Rack and Passenger from gem package manager I got the above error. I have tried various methods but it was not helpful for me. The below commands i have tried and it worked for me so far. i hope it helpful for you.

[vagrant@centos65 puppet]$ sudo gem install rack -v 1.6.0

Successfully installed rack-1.6.0

1 gem installed

Installing ri documentation for rack-1.6.0...

Installing RDoc documentation for rack-1.6.0...

[vagrant@centos65 puppet]$ sudo gem install rake -v 10.4.2

Successfully installed rake-10.4.2

1 gem installed

Installing ri documentation for rake-10.4.2...

Installing RDoc documentation for rake-10.4.2...

[vagrant@centos65 puppet]$ sudo gem install daemon_controller -v 1.2.0 

Successfully installed daemon_controller-1.2.0

1 gem installed

Installing ri documentation for daemon_controller-1.2.0...

Installing RDoc documentation for daemon_controller-1.2.0...

[vagrant@centos65 puppet]$ sudo gem install passenger -v 4.0.56

Solution 2

I ran into this on Ruby 2.1.4 needed to update rubygems

gem install rubygems-update
update_rubygems

Solution 3

Are you getting confused between your system ruby and your implementation ruby?

Quick test if the output of sudo ruby -v is less than 2.3.0 then you will be.

If that's the case, you need to not use sudo and get your path sorted so that you can work with ruby with your user.

I'll standby on the delete key for this answer, just in case it's not :)

Share:
14,481
rubyman
Author by

rubyman

Updated on June 07, 2022

Comments

  • rubyman
    rubyman almost 2 years

    I am getting the following error while installing rack

    ❯ sudo -E gem install rack -v '2.0.0.alpha'

    ERROR: Error installing rack: rack requires Ruby version >= 2.2.2.

    The output of the ruby -v gives

    ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux-gnu]

    The output of gem -v gives

    2.5.1

    How can i fix this error?