简体   繁体   English

Gem :: InstallError:celluloid需要Ruby版本> = 1.9.2

[英]Gem::InstallError: celluloid requires Ruby version >= 1.9.2

I'm trying to install GitLab CI and I got this error. 我正在尝试安装GitLab CI,我收到了这个错误。

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

However, I think my ruby is up to date. 但是,我认为我的红宝石是最新的。

# ruby --version
ruby 1.9.3p286 (2012-10-12 revision 37165) [i686-linux]

# ls -l /usr/bin/ruby
lrwxrwxrwx 1 root root 22 Jan 26 11:20 /usr/bin/ruby -> /etc/alternatives/ruby

# ls -l /etc/alternatives/ruby 
lrwxrwxrwx 1 root root 18 Jan 26 12:17 /etc/alternatives/ruby -> /usr/bin/ruby1.9.3

# rvm list
rvm rubies
=* ruby-1.9.3-p286 [ i686 ]

# which bundle
/usr/local/rvm/gems/ruby-1.9.3-p286@global/bin/bundle

# which gem
/usr/local/rvm/rubies/ruby-1.9.3-p286/bin/gem

Any idea what's wrong with me here..? 我知道这里有什么问题..?

Most likely, your bundler or gem CLI tools are tied to an installation of Ruby 1.8. 最有可能的是,您的bundlergem CLI工具与Ruby 1.8的安装相关联。

Take a look at which bundle and which gem ; 看看which bundlewhich gem ; and inspect those files - they are built pointing to a particular ruby installation by default. 并检查这些文件 - 默认情况下,它们构建为指向特定的ruby安装。

(You probably need to install bundler for your current ruby version) (您可能需要为当前的ruby版本安装bundler)

I have this problem too. 我也有这个问题。 I use rbenv. 我用rbenv。

Here is my solution. 这是我的解决方案。

  1. Make sure your Ruby is loaded by rbenv 确保您的Ruby由rbenv加载
  2. $ gem install bundler
  3. $ rbev rehash

Now your gem should not pointed to your system Ruby. 现在你的gem不应该指向你的系统Ruby。

If you use debian-based linux, try sudo update-alternatives --config ruby and sudo update-alternatives --config gem . 如果您使用基于debian的linux,请尝试使用sudo update-alternatives --config rubysudo update-alternatives --config gem Helped me. 帮助过我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM