1

I'm using rbenv to set the ruby version.

ruby -v produces the expected 1.9.3

I can do gem install paperclip without a problem.

However, when I do bundle install it says:

Installing paperclip (3.1.2) 
Gem::InstallError: paperclip requires Ruby version >= 1.9.2.
An error occured while installing paperclip (3.1.2), and Bundler cannot continue.
Make sure that `gem install paperclip -v '3.1.2'` succeeds before bundling.

but, ruby -v says I'm running 1.9.3. Is bundler runnign as sudo? Have anyone addressed this problem?

Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67

3 Answers3

1

The problem was permission issues of my rbenv folder. This fixxed it:

sudo chown ubuntu /usr/local/rbenv/rubies -R

I am running ubuntu on AWS.

Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67
1

I don't know if it's too late for you guys, but I faced this problem today and was able to solve it by checking the "paperclip" official git page.

For me what solved it was changing the info on the gem file to:

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

Hope it helps you guys!

Regards

Luis

lbramos
  • 327
  • 1
  • 6
  • 19
-1

The answer is to build ruby 1.9.3 from source. There are instructions on both manually doing this-but then there's always RVM. If you have RVM installed on your machine, use it and NOT the apt-get for ruby versions greater than 1.8

To compile from source manually (not recommended) http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/

If you don't want to build from source, you can follow some instructions on adding a repo. others have hit the same error.

Community
  • 1
  • 1
Adam Miller
  • 1,756
  • 1
  • 25
  • 44
  • Adam, do you suggest that I also stop using bundler, and start writing in assembly code? – Victor Pudeyev Jul 18 '12 at 06:23
  • Actually, this particular answer has a lot of information behind it that I didn't include. I had the exact same problem as you 2 days ago-couldn't get paperclip to work with rails 3.2 and ruby 1.8. The basic information (not all the hell I went through trying to get ruby 1.9 on ubuntu like I wanted) is that the version of ruby released on ubuntu's repos will not install as ruby 1.9.2 or higher (essentially 1.9.3 because .2 had a problem). It installs as 1.9.3p0 or something. So the only alternative is to either compile it (or a ppa repo with it) or accept 1.8 and that you cant use paperclip. – Adam Miller Jul 19 '12 at 12:08
  • The entire idea of compiling is so that you can get back to using bundler and gem, not so you can get so close to the metal that your eyes bleed. I never said that. Compiling it requires the following: 1) download and untar it 2) ./configure 3) sudo make install. But I should note that while I did manage to get higher versions of ruby, irb, gem, and bundler, I didn't manage to get paperclip working. Let me know if you get paperclip working though. – Adam Miller Jul 19 '12 at 12:14
  • [And there are instructions available](http://oylenshpeegul.typepad.com/blog/2011/11/ruby-193-on-ubuntu-1110.html). [You should read each of these to understand a little of the route required to install ruby 1.9.3](http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/). I followed these a few days ago to no avail. Eventually I just rolled back to using ruby 1.8 and carrierwave. – Adam Miller Jul 19 '12 at 12:17
  • Adam, you are aware of the fact that both rvm and rubyenv compile rubies from source, yes? Furthermore, I use three rubies: 1.8.7, 1.9.2 and 1.9.3 so do you suggest that I compile each manually _and_ write my own ruby version management script? – Victor Pudeyev Jul 19 '12 at 18:39
  • Paperclip works now, though I don't know why or how to reproduce the steps. I didn't do anything particularly insightful to make it work. – Victor Pudeyev Jul 19 '12 at 18:40
  • Yeah, I remember trying to get RVM to do that, but when I tried to get RVM to install through apt-get it failed partway in. Maybe that's why I had so much trouble. RVM's compiling ruby from source would certainly explain why the apt-get doesn't pull the correct ruby version down-all the dev for that is in the RVM, not apt repos. Makes total sense now-someone did all the work that I was talking about for everybody else! – Adam Miller Jul 19 '12 at 18:58