How to downgrade rails version on debian
If you want to downgrade rails (aka install an old version of rails) on debian first of all install rails gems. Execute next command as root:
apt-get install rubygems
Remove rails package of debian if it’s actually installed
apt-get remove rails
Now install rails by gems utility and force the right version. Example:
gem install -v=2.0.2 rails --include-dependencies
Now put gems bin folder on bash PATH. Edit /etc/bash.bashrc
export PATH=$PATH:/var/lib/gems/1.8/bin
Note: version of rubygems may be different, check your right PATH to gems bin folder
If all goes right now you can use your preferred rails version. Note, rails command from gems is little different between the script that debian package installs. Just check params: call rails command without params.
$ rails
Usage: /var/lib/gems/1.8/bin/rails /path/to/your/app [options]
Options:
-r, --ruby=path Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).
Default: /usr/bin/ruby1.8
-d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).
Default: mysql
-f, --freeze Freeze Rails in vendor/rails from the gems generating the skeleton
Default: false
Rails Info:
-v, --version Show the Rails version number and quit.
-h, --help Show this help message and quit.
General Options:
-p, --pretend Run but do not make any changes.
--force Overwrite files that already exist.
-s, --skip Skip files that already exist.
-q, --quiet Suppress normal output.
-t, --backtrace Debugging: show backtrace on errors.
-c, --svn Modify files with subversion. (Note: svn must be in path)
That’s all folks! 🙂