问题
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:~$
回答1:
bundle install and ruby versions?
Build it from source:
http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/
回答2:
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
)
来源:https://stackoverflow.com/questions/11162301/paperclip-installation-error