简体   繁体   English

Ruby回形针:说它需要版本> = 1.9.2,但我有1.9.3

[英]Ruby paperclip: says it needs version >= 1.9.2, but I have 1.9.3

I'm not sure what's going on here. 我不确定这里发生了什么。

$ sudo gem install paperclip
ERROR:  Error installing paperclip:
    paperclip requires Ruby version >= 1.9.2.
$ ruby --version
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]

Why is it failing when the version should suffice? 当版本足够时为什么会失败?

I would avoid using sudo with gem. 我会避免使用带有宝石的sudo。 I just recently installed paperclip 3.0 with no problems at all on Ruby 1.9.3p429 using: 我刚刚在Ruby 1.9.3p429上安装了paperclip 3.0而没有任何问题:

gem install paperclip

If you are using RVM, try issuing this command: 如果您使用的是RVM,请尝试发出以下命令:

rvm 1.9.3 do gem install paperclip

If that does not work you might want to try installing using this command in the gemfile: 如果这不起作用,您可能想尝试在gemfile中使用此命令进行安装:

gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"

It will grab the latest version. 它将获取最新版本。 If you are using it with Rails you will want to put the requirement in your gemfile and then bundle install to grab all the other dependencies, and then rake the db. 如果您在Rails中使用它,您将需要将需求放在gemfile中,然后捆绑安装以获取所有其他依赖项,然后rake db。

For more, see GitHub Paperclip Repo . 有关更多信息,请参阅GitHub Paperclip Repo

which ruby version are you using..? 您使用哪个红宝石版本..?

do rvm list . rvm list The result will be the list of all installed rubys, like 结果将是所有已安装的rubys的列表,例如

   rvm rubies

   jruby-1.7.0 [ x86_64 ]
   ruby-1.8.7-p371 [ x86_64 ]
   ruby-1.9.2-p320 [ x86_64 ]
=> ruby-1.9.3-p327 [ x86_64 ]
*  ruby-1.9.3-p374 [ x86_64 ]
   ruby-1.9.3-p385 [ x86_64 ]
   ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Then do rvm use 1.9.3-p374 # You can use any ruby , which you actually need. 然后rvm use 1.9.3-p374 #你可以使用你真正需要的任何红宝石。

After that do a bundle install . 之后进行bundle install This will solve the issue. 这将解决问题。

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

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