简体   繁体   English

安装gem factory_girl和ruby版本时出错

[英]Error on install gem factory_girl and ruby version

I try to install skylinecms but I have a problem with installing the gem. 我尝试安装skylinecms,但安装gem时遇到问题。
The gem factory_girl asked me to use version> = 1.9.2 of Ruby 宝石factory_girl要求我使用Ruby的version> = 1.9.2

atmoner@atmoner:~/base_ror$ sudo gem install skylinecms
ERROR:  Error installing skylinecms:
    factory_girl requires Ruby version >= 1.9.2.

ruby -v 红宝石-v

atmoner@atmoner:~/base_ror$ ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]

I have tried to change ruby version to 1.9.2 我试图将红宝石版本更改为1.9.2

atmoner@atmoner:~/base_ror$ rvm use 1.9.2
Using /home/atmoner/.rvm/gems/ruby-1.9.2-p320

But still same problem 但是还是一个问题

atmoner@atmoner:~/base_ror$ sudo gem install skylinecms
ERROR:  Error installing skylinecms:
    factory_girl requires Ruby version >= 1.9.2.

what's the source of this problem? 这个问题的根源是什么?
you have an idea? 你有个主意吗?

You shouldn't use sudo with rvm , as it creates a new subshell with a completely new environment. 不应将sudorvm一起rvm ,因为它会创建一个具有全新环境的新子shell。 See more about sudo and rvm here: RVM and 'sudo' 在此处查看有关sudo和rvm的更多信息: RVM和'sudo'

Most likely your system ruby version is 1.8.7 , and that is what is getting invoked when you run sudo gem install skylinecms . 您的system ruby版本很可能是1.8.7 ,这是在运行sudo gem install skylinecms时调用的sudo gem install skylinecms You can verify that with the following commands: 您可以使用以下命令进行验证:

rvm use system
ruby -v

Try installing the skylinecms gem without sudo . 尝试安装没有sudoskylinecms gem。

Best to use per-project gemsets as suggested in rvm best practices 最好使用RVM最佳做法中建议的按项目使用的宝石

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

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