I am having trouble uninstalling Rails 4.1.5 and installing Rails 4.0.8
I know I'm a bit late however I am answering in case others need an answer of how to manage gem versions. The linked duplicate question offers a perfectly fine answer to the question but does not give guidance to how to easily manage this long term. I do the following before starting every new project.
First you need rvm to manage ruby versions and create gemsets. With gemsets you can create isolated groups of gems that are project or ruby or rails version specific (it's up to you how you organize yourself).
After installing a version of ruby to use you create a gemset and tell your system to use this version of ruby with this gemset.
Then select the gemset and install the version of rails you want to use into the gemset. You will also need to install bundler into the gemset.
Once you have this setup you can insert the following lines into your rails gem file to tell this project which ruby version, rails version and gemset to use (in my example I am using ruby version 2.1.5 with the gemset named scan and the rails version 4.0.8)
ruby '2.1.5'
#ruby-gemset=scan
gem 'rails', '4.0.8'
Then cd into the rails project directory and run bundle install
. Bundler will install the gems from your project's gem file into the selected gemset. Now you have an isolated and stable system for the project. If you have another project with different ruby version, rails version and gemset any changes there will not affect anything here.
For more details on how to setup rvm just go to the website and read the documentation. It's really easy to use and will save you many headaches.
Rails gem update not working (version 4.1.1 to 4.2.0) as a solution to warning: circular argument reference error
Try the following :
rvm use ruby-2.2.0@rails4.2 --create
gem install rails
rails -v
This should give you rails 4.2
Error in installing new rails?
Uninstall rails as:-
gem uninstall railties
Select the option of railties-4.1.1 to uninstall it.
Install rails as
gem install rails --version 4.0.5
How to set default rails version for a project?
To use an older version than the latest you have installed, just wrap the version number in underscores:
rails _1.2.1_ myproject
Updating from Rails 4.0 to 4.1 gives sass-rails railties version conflicts
From comments, update to:
gem 'rails', '~> 4.1.1'
Uninstalled old version of rails and now no longer have rails executable
This issue has been resolved through Nitrous support channels. Somehow the file /home/action/.rvm/gems/ruby-2.0.0-p247/bin/rails
was missing, and gem install rails
did not add it. Manually adding this file with the following contents solved the issue.
#!/usr/bin/env ruby_noexec_wrapper
#
# This file was generated by RubyGems.
#
# The application 'railties' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/
version = $1
ARGV.shift
end
end
gem 'railties', version
load Gem.bin_path('railties', 'rails', version)
Related Topics
Ruby - Extracting the Unique Values Per Key from an Array of Hashes
Installing Libyaml for Ruby on a MAC Osx (Lion)
Is There a Bug in Ruby Lookbehind Assertions (1.9/2.0)
How to Fix a Slow Implicit Query on Pg_Attribute Table in Rails
Ruby - Does Array a Contain All Elements of Array B
How to Read a Gzip File Line by Line
What Are Symbols and How Do We Use Them
Could Not Find Rake-10.1.0 in Any of the Sources
Many: 'Require': Cannot Load Such File -- "Gem_Name" (Loaderror) After Upgrade of Ruby/Rails
Ruby: Uri::Invalidurierror (Uri Must Be Ascii Only
Ruby Keyword Arguments of Method
Ruby: What Is the Order of Keys/Values Returned by Hash.Keys and Hash.Values Methods
How to Shorten a Uuid to a Specific Length
Determine the Class to Which a Method Belongs in Rails