Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update package database:
- sudo apt-get update
- install curl which will be use to fetch the RVM script:
- sudo apt-get install curl
- With curl installed, we can install RVM with this command(RVM and ruby will be installed in the home directory.):
- curl -L get.rvm.io | bash -s stable --auto
- reload the ~/.bash_profile file:
- . ~/.bash_profile
- rvm requirements command will tell us what other packages we need to install for Ruby to work:
- rvm requirements
- install the required package in the for ruby section, that might look similar(the current might be different.) below:
- sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
- curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
- libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison \
- subversion pkg-config
- with rvm install ruby 1.9.3:
- rvm install 1.9.3
- to use ruby 1.9.3, run rvm command below:
- rvm use 1.9.3
- display the ruby version:
- ruby -v
- set as the default version(at the time of install the patchlevel is -p374. the current might be different.
- Now whenever we open a new bash session for this user we’ll have Ruby available for us to use.):
- rvm --default use 1.9.3-p374
- with rvm install rails:
- gem install rails -v 3.2.9
- Create you new ruby on rails project:
- sudo mkdir ~/ruby_project_Name
- sudo chmod -R 777 ~/ruby_project_name
- rails new ruby_project_name
- Enter into that directory:
- cd project_name
- Turn on the rails server and access it in the browser(http://site_ip_or_hostname:3000):
- rails server
- notes:
- When running the rails server you encounter missing gem error(like execJs gem), add it in the Gemfile and run bundle install:
- sudo nano ~/ruby_project_name/Gemfile
- add and save:
- gem 'execJS'
- run command to install the gem:
- bundle install
- run rails server again:
- rails server
- If you want to install mysql2 gem for your application then install libmysqlclient-dev first.For pg gem install libpq-dev first.
- To generate an .rvmrc(per project gemsets) file(run this inside your project directory.):
- rvm use 1.9.3-p374@ruby_project_name --rvmrc --create
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement