How to downgrade Rails version?
replace
gem 'rails','3.0.7'
withgem 'rails', '3.0.3'
in your gemfileThen run bundle
On a second note why not upgrade the server to rails 3.0.7?
How to switch to an older version of rails
First, uninstall the version of Rails you have:
gem uninstall rails
Next, install the version of Rails you want, like so:
gem install rails -v 3.1.12
There are a few ways to have both "installed" at the same time. As Joe Frambach suggested, you could install Rails 4 in a VM. You could also install RVM - the Ruby enVironment Manager - and use separate gemsets to keep the two versions of Rails apart. But if you are just learning you may not want to bother with this.
Edit: @Shadwell's answer got it right, although it could use some expansion, which I'll do here:
> rvm gemset create rails3
> rvm gemset use rails3
> gem install rails -v 3.1.12
> rails my_new_app
What's the proper way to downgrade a gem?
gem "factory_girl", "2.0.0.rc1", :group => :test
in your gem file, and then run bundle update factory_girl
Can I downgrade my app to older versions of Ruby and Rails? How?
Porting your app to an older Ruby and Rails would be a bad idea. Not only would you be exposing yourself to security holes that have been fixed in more recent releases (Ruby 2.0 will be end of lifed on February 24, 2016, and there have been important security patches since Rails 4.2.4), you would be swimming against the continuous pressure to upgrade exerted by the other gems you might want to use, documentation, etc.
There is probably nothing preventing you from installing a current version of Ruby in your own account on the hosting provider using a version manager like rbenv or rvm. (I recommend rbenv.) You are also probably free to install any gems you like (probably with bundler), including current versions of Rails.
If that hosting provider does prevent you from using or installing a newer Ruby or Rails, find a different hosting provider. That one will fail soon enough anyway.
Related Topics
Bundler Using Wrong Ruby Version
In Ruby, How to Be Warned of Duplicate Keys in Hashes When Loading a Yaml Document
Regex to Check Alphanumeric String in Ruby
Download a Carrierwave Upload from S3
Binding to Networking Interfaces in Ruby
How to Create a Custom Sort Method in Ruby
Ruby Trying to Grasp a New Notation. (Inject(: ) Vs Select(&:Even); Why One Has &)
Recording Audio Through Rtmp/Rails
Sorting a Multidimensional Array in Ruby
Belongs_To Presence in Rails 5 Not Working
Posting Ruby Data in JSON Format with Net/Http
How to Remove Header and Footer from Some of The Pages in Ruby on Rails