- 1 Ruby on Rails Centos Installation Guide!
- 2 Installation
- 3 What’s now?
- 4 Read more…
Ruby on Rails Centos Installation Guide!
For my ruby on rails centos server, I installed a fresh Centos 6.3 minimal.
yum install ruby yum install ruby-devel ruby-irb ruby-rdoc ruby-ri
Option 1: Install Rubygems using yum
this is the easy way. install from source if you have problems or you need the more recent rubygems version.
yum install rubygems
Option 2: Install Rubygems from sources
access the latest available gems by visiting: http://rubygems.org/pages/download.
remember to ‘yum remove rubygems’ if you’ve installed rubygems earlier using yum.
mkdir ~/src cd ~/src wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz tar xzvf rubygems-1.8.24.tgz rm rubygems-1.8.24.tgz -f cd rubygems-1.8.24 ruby setup.rb
gem update gem update --system
make sure you have gcc and make installed. it’s used by gem and needed to install gems like sqlite3-ruby
yum install gcc gcc-c++ make -y
gem install rails -V
-V for details of the process
ERROR: Error installing rails:
activesupport requires Ruby version >= 1.X.X.
If you get this error while installing rails you need to
yum remove ruby
and then install it from source (check if newer versino exist):
yum groupinstall “development tools”
tar -zxvf ruby-2.1.0.tar.gz
# and then some cleaning…
It will install rubygems too for you.
then try to install rails again.
you have ruby on rails (rails) installed!
you have gem package manager installed. you can view installed packages with:
You will probably need an sql. Rails version 2.0+ uses sqlite3 as its default database – you can, of course, use others
yum install sqlite-devel
After you have sqlite installed, install the gem with:
gem install sqlite3-ruby
to test you have installed everything as needed do the following test using irb:
irb #irb(main):001:0> require 'rubygems' => true #irb(main):002:0> require 'sqlite3' => true
Creating your First Project
Using an SQLite3 database for data storage is a zero configuration database that just works. ‘db::rake’ will create the database.
cd ~/ rails new project cd project rake db:create
gem install therubyracer
Rails adds the therubyracer gem to Gemfile in a commented line for new apps and you can uncomment if you need it.
therubyrhino is the recommended runtime for JRuby users and is added by default to Gemfile in apps generated under JRuby.
also, from rails 3 you can use node.js for compiling the coffeescript.
edit the ‘Gemfile‘ file inside your new project directory and uncomment (delete the #) from the line
# gem ‘therubyracer’ ….
gem ‘therubyracer’ ….
save.. and your project should now work.
bundle install rails server
if everything correct, This will fire up WEBrick web-server (Rails can also use several other web servers like apache or nginx). To see your application in action, open a browser window and navigate to http://localhost:3000. You should see Rails default page.
read the full ruby on rails guide: Getting Started with Rails. you have everything installed and ready for this guide 🙂
read more on web-servers in iTekBlog: