Advertisement
shokti

ubuntu 12.10 - rvm ruby 1.9.3 and rails 3.2.9 install

Feb 8th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. update package database:
  2. sudo apt-get update
  3.  
  4. install curl which will be use to fetch the RVM script:
  5. sudo apt-get install curl
  6.  
  7. With curl installed, we can install RVM with this command(RVM and ruby will be installed in the home directory.):
  8. curl -L get.rvm.io | bash -s stable --auto
  9.  
  10. reload the ~/.bash_profile file:
  11. . ~/.bash_profile
  12.  
  13. rvm requirements command will tell us what other packages we need to install for Ruby to work:
  14. rvm requirements
  15.  
  16. install the required package in the for ruby section, that might look similar(the current might be different.) below:
  17.  
  18. sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
  19. curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
  20. libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison \
  21. subversion pkg-config
  22.  
  23.  
  24. with rvm install ruby 1.9.3:
  25. rvm install 1.9.3
  26.  
  27. to use ruby 1.9.3, run rvm command below:
  28. rvm use 1.9.3
  29.  
  30. display the ruby version:
  31. ruby -v
  32.  
  33. set as the default version(at the time of install the patchlevel is -p374. the current might be different.
  34. Now whenever we open a new bash session for this user we’ll have Ruby available for us to use.):
  35. rvm --default use 1.9.3-p374
  36.  
  37. with rvm install rails:
  38. gem install rails -v 3.2.9
  39.  
  40. Create you new ruby on rails project:
  41. sudo mkdir ~/ruby_project_Name
  42. sudo chmod -R 777 ~/ruby_project_name
  43. rails new ruby_project_name
  44.  
  45. Enter into that directory:
  46. cd project_name
  47.  
  48. Turn on the rails server and access it in the browser(http://site_ip_or_hostname:3000):
  49. rails server
  50.  
  51. notes:
  52.  
  53. When running the rails server you encounter missing gem error(like execJs gem), add it in the Gemfile and run bundle install:
  54. sudo nano ~/ruby_project_name/Gemfile
  55.  
  56. add and save:
  57. gem 'execJS'
  58.  
  59. run command to install the gem:
  60. bundle install
  61.  
  62. run rails server again:
  63. rails server
  64.  
  65. If you want to install mysql2 gem for your application then install libmysqlclient-dev first.For pg gem install libpq-dev first.
  66.  
  67. To generate an .rvmrc(per project gemsets) file(run this inside your project directory.):
  68. rvm use 1.9.3-p374@ruby_project_name --rvmrc --create
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement