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!🙂

Tags: , ,

About Giulio Turetta

Sviluppo e curo siti web dal 1998, amo internet e le opportunità che ci offre. Grazie anche a te, che fai parte di questo mondo fantastico.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: