起因: http://stackoverflow.com/questions/33225915/ruby-sinatra-throwing-wrong-number-of-arguments-2-for-1-in-const-get

升级方案

参考链接: http://ask.xmodulo.com/upgrade-ruby-centos.html


If you already installed ruby and ruby-devel packages with yum before, remove them first before upgrading Ruby.

1
sudo yum remove ruby ruby-devel

Build and install the latest Ruby from the source as follows.

1
2
3
4
5
6
7
8
sudo yum groupinstall "Development Tools"
sudo yum install openssl-devel
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar xvfvz ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
sudo make install

Finally, update Rubygems and Bundler.

1
2
sudo gem update --system
sudo gem install bundler

If you have any pre-installed gems with an older version of Ruby, update the gems.

1
sudo gem update

To use the installed Ruby/Rubygems, open a new terminal. Then check the version of installed Ruby and Rubygems as follows.

1
2
ruby --version
rubygems --version