简体   繁体   中英

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. I just recently installed paperclip 3.0 with no problems at all on Ruby 1.9.3p429 using:

gem install paperclip

If you are using RVM, try issuing this command:

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:

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.

For more, see GitHub Paperclip Repo .

which ruby version are you using..?

do rvm list . The result will be the list of all installed rubys, like

   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.

After that do a bundle install . This will solve the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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