As a RoR developer the first hurdle I faced was proper installation of rails using rvm, same as many others. Installed and re-installed number of times, followed number of tutorials. From that experience trying to consolidate the steps need for installation that I found from different tutorials.
Lets directly go to the steps.
First we need to set up some platform for installing the RVM and Rails.
To install the latest RVM first we need to remove the old version if it is there
Then we need to remove two files from the system
We can confirm the removal using the below command
The next step is downloading and installing latest stable RVM available. For that we can use curl command.
The above command will download and install the latest stable RVM package. At the end of the installation the system may throw some messages by asking some plug-ins are missing. Mostly the the system will show the required plug-in name. Then we can install those using apt-get command.
Otherwise from my experience you can give the below command to solve the problem. This will install almost all dependencies needed by RVM.
Then run the following command for confirmation.
We are doing this to make RVM to use as function. Then run
if you are getting rvm is a function as out-put the problem is solve.
Now we done with all the foundations. Next step is installing ruby. We can install different versions using RVM.
If number of versions are there in our system then we can use the following command to use a desired version as default.
Then we can check which ruby we are using as default by the following command.
Now we can install rails to our system. We will install rails using "gem" installer. If the system throwing any error like gem is not found,you need to install the gem installer first. After that we can install rails.
If you use the above command it will install the latest version of rails. If spesific version need to be installed,can use the below command
Run the below command in your terminal
If you want to disable installation of gem documentation while installing new gems,you can try the following command. It is optional.
Lets enjoy the rails experience.
Lets directly go to the steps.
First we need to set up some platform for installing the RVM and Rails.
sudo apt-get install build-essential git-core curl libmysqlclient16-dev nodejsthese are some plug-ins to make the job easy.
To install the latest RVM first we need to remove the old version if it is there
sudo apt-get --purge remove ruby-rvm
Then we need to remove two files from the system
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
We can confirm the removal using the below command
env | grep rvmIf the RVM is still there it shows the path as out put.
The next step is downloading and installing latest stable RVM available. For that we can use curl command.
curl -L get.rvm.io | bash -s stable --auto
The above command will download and install the latest stable RVM package. At the end of the installation the system may throw some messages by asking some plug-ins are missing. Mostly the the system will show the required plug-in name. Then we can install those using apt-get command.
Otherwise from my experience you can give the below command to solve the problem. This will install almost all dependencies needed by RVM.
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Then run the following command for confirmation.
source "/usr/local/rvm/scripts/rvm" or source ~/.rvm/scripts/rvm
We are doing this to make RVM to use as function. Then run
type rvm | head -n 1
if you are getting rvm is a function as out-put the problem is solve.
Now we done with all the foundations. Next step is installing ruby. We can install different versions using RVM.
rvm install ruby-version(eg: 1.9.2 or 1.9.3 )We only need to give the version number, no need of giving prefix ruby
If number of versions are there in our system then we can use the following command to use a desired version as default.
rvm --default use ruby-version(eg: 1.9.2 or 1.9.3)
Then we can check which ruby we are using as default by the following command.
ruby -v
Now we can install rails to our system. We will install rails using "gem" installer. If the system throwing any error like gem is not found,you need to install the gem installer first. After that we can install rails.
gem install rails
If you use the above command it will install the latest version of rails. If spesific version need to be installed,can use the below command
gem install rails 'version'(eg: 3.1.2 or 3.1.3)
Run the below command in your terminal
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
If you want to disable installation of gem documentation while installing new gems,you can try the following command. It is optional.
echo "gem: --no-rdoc --no-ri" > ~/.gemrcThe above command will add this line to "gemrc" file.
Lets enjoy the rails experience.
No comments:
Post a Comment