1

When I try to install friendly_id :version => "~> 3.0.6" with rails 2.3.3 wtih ruby 1.8.7 getting error for Ruby version

ERROR: Error installing friendly_id: activesupport requires Ruby version >= 1.9.3.

Current version of Rails is 2.3.3 and Ruby is 1.8.7

I have goggled but couldn't find any solution, Please help me for resolving it.

my gems are:

and gem list

* LOCAL GEMS *

actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activeresource (2.3.3)
activesupport (2.3.18, 2.3.3)
atomic (1.1.14)
authlogic (2.1.9)
bundler (1.3.5)
bundler-unload (1.0.1)
crummy (1.7.2)
currencies (0.4.2)
declarative_authorization (0.5.7)
exceptional (2.0.6)
geoip (1.3.0)
geokit (1.6.7)
geonames (0.3.3)
god (0.13.3)
i18n (0.6.5)
json (1.8.0)
minitest (4.7.5)
multi_json (1.8.0)
rack (1.0.1)
rails (2.3.3)
rake (10.1.0)
rdoc (4.0.1)
rdoc-data (4.0.1)
rubygems-bundler (1.2.2)
rubygems-update (1.4.2)
rvm (1.11.3.8)
SystemTimer (1.1.3)
thread_safe (0.1.3)
tzinfo (1.1.0, 0.3.37)
validates_timeliness (2.3.2)

Please help me how to install friendly_id with rails2.3.3 and Ruby 1.8.7

Vijay Chouhan
  • 4,613
  • 5
  • 29
  • 35
  • `activesupport requires Ruby version >= 1.9.3.` I think you need `Ruby 1.9.3`. Just try to install with this version – ѕтƒ Sep 26 '13 at 10:36
  • @ѕтƒ But I have doubt this app was running with `Ruby 1.8.7` and when I Switch on `ruby 1.9.3` then I will have and issue ? i.e. `Ruby 1.9.3` is compatible old syntax and gems for `ruby 1.8.7` – Vijay Chouhan Sep 26 '13 at 10:40
  • Use Ruby 1.9.3. Ruby 1.8.7 has reached its end of life. Any code that you're using that expressly depends on 1.8.7 should be upgraded to 1.9.3 – Ryan Bigg Sep 26 '13 at 11:17
  • Is the error message you provided correct, as in copy & paste? It seems confusing to me, requiring Ruby >= 1.93 with ... Ruby = 1.8.7? That doesn't make much sense. Either way, and accepting the recommendation to go to 1.9.3+, I've found it necessary at times to eliminate conflicts by downloading the gem source, updating the gemspec, rebuilding and installing the gem, then testing the living ... out of it. – Richard_G Sep 26 '13 at 13:23
  • @R_G I have updated error message in the question – Vijay Chouhan Sep 26 '13 at 14:09
  • That makes a lot more sense. – Richard_G Sep 26 '13 at 18:39
  • OFF TOPIC: you should upgrade your version of rails - 2.3.3 is vulnerable to security issues - see https://www.google.com/search?q=site%3Aweblog.rubyonrails.org&q=%5BSEC%5D and specifically - http://weblog.rubyonrails.org/2013/1/8/Rails-3-2-11-3-1-10-3-0-19-and-2-3-15-have-been-released/ - you should upgrade to 2.3.18 if possible – house9 Sep 26 '13 at 18:54

1 Answers1

1

I think you need to check exactly what friendly_id version you are attempting to install outside of Gemfile specifications.

According to friendly_id documentation here:

For (Active Record) 2.3 support, you can use FriendlyId 3.x, which will continue to be maintained until people don't want it any more.

So, 3.0.6 should work for you, if that is what you are installing. Use "gem list friendly_id" to see what you have locally, which should be nothing. Use "gem list friendly_id -r" to see what is available remotely. It will try to install the highest level available by default. What I got was friendly_id (4.0.10.1).

Do you have 3.0.6 downloaded to your system? If you do, are you using gem build/gem install to build and install it? At what point do you get the error message? The gem install will install the locally built version by default if you are in its directory...

If all of this still fails, post the Gemspec file from it so that we can review the requirements. You may need to update these before the build/install. However, YMMV and you must test it fully before you can trust it if you change Gemspec.

However, let me reiterate the recommendation to upgrade to current supported software, especially if you are making extensive changes. As you indicated, you may face having to upgrade both your local code and the installed gems. That is the price you pay for support and advanced features.

Richard_G
  • 4,700
  • 3
  • 42
  • 78