Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Rails to use gem of version X

I have a rails app with the config/environment.rb line

config.gem 'authlogic', :version => '2.1.2'

The system gem for authlogic is 2.1.4 The one in my GEM_PATH is 2.1.2

No matter what I try, Rails is only using the 2.1.4 version, which is a problem. How to force rails to use 2.1.2?

Thanks

like image 222
David Lazar Avatar asked May 28 '10 22:05

David Lazar


People also ask

How do I use a specific version of a gem?

You can install a specific gem version with gem install [name] -v [version] and use it as [name] _[version]_ [command] [line] [args] .

How do I install an older version of gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

How do I know which version of rails is installed?

To find out what the most recent Rails version is, use the command gem search rails | grep "^rails " . As I am writing this, it is 5.0. 1. Check that the correct version has been installed using bundle exec rails -v which should output Rails 5.0.


1 Answers

I recommend using Bundler

like image 175
pjb3 Avatar answered Nov 06 '22 10:11

pjb3