0

I cannot understand the reason for failing the installation:

pkerur@ubuntu:~$ rails --version
Rails 3.2.3

pkerur@ubuntu:~$ uname -a

Linux ubuntu 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:21:07 UTC 2012 i686 i686 i386 GNU/Linux

pkerur@ubuntu:~$ ruby --version

ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]

pkerur@ubuntu:~$ sudo gem install paperclip

ERROR:  Error installing paperclip:
    paperclip requires Ruby version >= 1.9.2.

pkerur@ubuntu:~$ 
chiwangc
  • 3,566
  • 16
  • 26
  • 32
  • I know this isn't a very good solution, but you could always resort to using carrierwave. I'm dealing with the exact same problem you are... – Adam Miller Jul 17 '12 at 20:03

2 Answers2

0

There is a hard difference between sudo command and command, because sudo'ing messed up the environmental variables. I bet if you do sudo ruby -v it will not be 1.9.3.

The solution would depend on many things. Try rvm? Try gemsets? Make whatever folder writeable by non-superuser to not require sudo? (sudo chown <your_yourname> <directory> -R)

Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67
  • You answer kind of helped me i'm not on 1.9.3 whe i sudo to ask the ruby version. How to deal with it ? And make the sudo read the right version ? Or make paperclip calls the user's path which is on the right ruby version ? – Ben Feb 10 '13 at 23:45
  • Ben, are you using rvm? if no, try using rvm. I recommend DO NOT use `sudo ruby ...` Install ruby gems where a non-sudo user can update them, and avoid using sudo. Hope this helps. – Victor Pudeyev Feb 20 '13 at 18:11
  • actually, it worked like a charm with the most simple and basic ruby install… no RVM, no nothing… I won't be able to use multiple ruby version, but at least, everything is very clean. I was aware of this non sudo thing, but it still ended to be kind of tricky – Ben Feb 20 '13 at 20:29
  • And yep, I was looking for the link… it is just above. That is what I was talking about. http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/ clean! – Ben Feb 20 '13 at 20:39