"Paperclip require Ruby version >- 1.9.2" when using 1.9.3 #830

Closed
coneybeare opened this Issue Apr 16, 2012 · 13 comments

Projects

None yet

10 participants

@coneybeare
[ps6736]$ rvm list

rvm rubies

   ruby-1.8.7-p358 [ x86_64 ]
=* ruby-1.9.3-p125 [ x86_64 ]

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

[ps6736]$ gem install paperclip
ERROR:  Error installing paperclip:
    paperclip requires Ruby version >= 1.9.2.
[ps6736]$ 
@sikachu
Member
sikachu commented Apr 16, 2012

I can't reproduce here:

[~] ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
[~] gem install paperclip
Fetching: paperclip-3.0.2.gem (100%)
##################################################
#  NOTE FOR UPGRADING FROM PRE-3.0 VERSION       #
##################################################

Paperclip 3.0 introduces a non-backward compatible change in your attachment
path. This will help to prevent attachment name clashes when you have
multiple attachments with the same name. If you didn't alter your
attachment's path and are using Paperclip's default, you'll have to add
`:path` and `:url` to your `has_attached_file` definition. For example:

    has_attached_file :avatar,
      :path => ":rails_root/public/system/:attachment/:id/:style/:filename",
      :url => "/system/:attachment/:id/:style/:filename"

Successfully installed paperclip-3.0.2
1 gem installed
[~] 
@sikachu sikachu closed this Apr 16, 2012
@lukas2
lukas2 commented Jul 3, 2012

Just for the record: I just had the same problem. I had a 1.9.3 ruby installed on an Ubuntu server without RVM. However, 1.8 files were still present on the system.

Removing 1.8 properly seems to have fixed the problem for me.

@sikachu
Member
sikachu commented Jul 3, 2012

Ah, so it seems like somehow picking up Ruby 1.8. That's interesting.

@maintux
maintux commented Jul 8, 2012

@coneybeare without remove ruby 1.8.7 you can install paperclip like this: "rvm 1.9.3 do gem install paperclip"

@JeremyMcCormick

Hello, I know this bug report is closed but I wanted to ask a question. If you are NOT using RVM and this error occurs, does this mean that ruby 1.8.7 is installed someplace on the system e.g. with the package manager? All the other Gems seem to find my current version of 1.9.2 just fine but Paperclip has some problems, and I get the error listed here. And I'm fairly well convinced that we've ripped out ruby 1.8 or at least the one in the bin dir is the current one. So I'm confused. Any further explanation for it?

@jyurek
Member
jyurek commented Jan 8, 2013

@JeremyMcCormick I would have to assume your gem executable is either detecting 1.8 somewhere or is itself running on 1.8.*, as the detection of ruby version is done by rubygems and not by paperclip itself.

@JeremyMcCormick

Thanks for the info about how that works.

BTW, I seem to have duplicated the issue on this page with a recent bug report I made as I didn't see this one.

#1127

Then my further questions are...

Why would every other Gem that gets installed not have this problem? Is it because they accept either Ruby 1.8 or 1.9 or don't check for an explicit version? This seems rather unlikely, as my project ends up pulling in about 30 different Gems. And I'm assuming at least one of them explicitly requires Ruby 1.9, so I'm just wondering if paperclip is doing something different here that causes this problem.

There's a lot of threads on the internet (stackoverflow etc.) which mention this issue but no definitive resolutions are given, so I'm hoping to get a clear solution to this.

@jyurek
Member
jyurek commented Jan 8, 2013

Honestly, I don't know why it's like this. But given that this is managed by rubygems and not paperclip, and we're specifying it in the way that is recommended, it shouldn't be an issue.

@JeremyMcCormick

Okay, any tips on debugging this from the problemmatic system? How do I tell what ruby version the gem executable is seeing? Can I somehow get more verbose feedback when I run bundle install in order to tell exactly what Ruby Paperclip is finding? I'm not that knowledgeable about what gem is actually doing under the hood so any feedback appreciated.

Strangely enough, I have another Ubunutu machine, which is fairly similar, on which this problem does NOT occur, and I think that one even has Ruby 1.8.7 and 1.9.2 installed alongside each other.

@bbnnt
bbnnt commented Feb 10, 2013

@sikachu can't reproduce neither, but it does fail as mentionned above when deploying. You know what can be wrong ?

@manishnath

Similar Issue faced .. When I install the gem seperately it gets installed but when I do bundle then it gives me the error. Any pointers?

@burnsjeremy

I just had the same issue, error every time on bundle install so I just installed the gem straight up "gem install paperclip" and it installed with no errors. Then I went back and ran "bundle update" and my bundle completed as intended.

@akausagi

I just had the same issue.
gem "paperclip"
in Gemfile maybe cause this issue.

We should write
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"
in Gemfile.

My bundle is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment