您的位置:首页 > 大数据 > 人工智能

Install Rails on ubuntu 12.04 LTS

2013-11-12 12:58 423 查看
  There are basically there ways to install Rails development environment on your ubuntu linux system, here I used 12.04 LTS version, so first on ubuntu apt manage system, we should check what version it provide, typing:


  So now we know that the latest version on ubuntu is 1.9.3, go to the rails official website we can see the recommended version is indeed this. so don't hesitate, just install it, using the super user, then we type:  



  After minutes, ruby has been installed on your machine, check if it's okay by typing:



  Now we see the ruby has been correctly installed, then we are going to install rails, rails is just a gem package of ruby, here comes a question, what version should I install and how to control it, in fact, this way to install rails, we have little right to control version, if you want to control a very version, you should install ruby by using rvm(ruby version manager), that is another way I want to introduce in the future. but we can check first what version ubuntu have, we can install the already available version of rails, ok next step by typing:



  you will find:



  After this check, it's time to install it, typing:

  




  Now we got the rails gem, we can do things with it now,

  create a new folder in /home/gordon, create a rails folder, cd into it and typing:

  


  it will install corresponding gem files such as rake,sqlite3,sass,uglifier etc. sometimes it will stuck at this period because this will download a lot, if it get stuck, just press control+C to stop it, cd into folder firstApp and typing,



  Try to start the server, if you get stuck in the previous phase and you pressed control + C, I believe you will face many errors telling you some gem packages are missed, but don't panic, now you can just typing gem install to fix every problem, for example, if you miss sqlite3, you can fix by typing:

  


  And at last, by fixing every problem, when you type rails server or rails s:



  If you get this picture on your screen, congratulation! welcome to the rails world, prepare to realize your dreams!

  I like this version's ruby and rails because I have been using it for a long time, but in the future, the version can change, so at that time, we will have to use the ruby version manager to control the version, althrough latest versions are always good, but when you are familiar with some thing, you may find it easy and intimate, so next blog I want to install rvm and then install rails.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: