How to install Ruby on Rails 3.0 on Ubuntu 10.10?
Ok, I hesitated to use rvm
as it seemed to be aimed at solving problems I didn't intend to have (multiple ruby versions? c'mon, I just want to play with rails...) and installing from source is generally something I want to avoid...
Anyway, I gave in and followed along with http://rvm.beginrescueend.com/rvm/install/
$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
Then (mostly suggested by the output of the above, but I needed to add libmysqlclient-dev
):
$ sudo aptitude install build-essential bison openssl libreadline5 \
libreadline5-dev curl git zlib1g zlib1g-dev \
libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 \
libxml2-dev libmysqlclient-dev
Then I edited my .bashrc
as required and opened a new terminal.
$ rvm install 1.9.2
$ rvm --default use 1.9.2
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
$ gem install rails
$ rails -v
Rails 3.0.1
After creating a new project, I still had a few things to do to make it work:
$ rails new myproject --database=mysql
$ cd myproject
$ emacs config/database.yml # set passwords
$ bundle install
$ rake db:create
$ rails server
And finally it all seems to be working. I hope that helps someone else, it certainly wasn't a particularly pleasant intro to a framework. I've reordered the commands I actually entered to avoid double handling for anyone following along.
Installing Rails 3.0.9 on Ubuntu 10.10 with RVM - no rails command in path
use gem install rails
instead of rvm gem install rails
Installing Rails 3.0.7 on Ubuntu 10.10
You've installed Rails under root user (sudo), and then you are trying to use it under local user. As far as it installed to root user you haven't got rails
command in your local user PATH
.
What you can do
- Add its Path manualy
- Install it via local user
- Use RVM
I prefer to use RVM.
As far as you are using RVM, you don't need to use sudo
. But when you need it you can use rvmsudo
, but not in this case. Just
gem install rails
Rails install fails on Ubuntu 10.10
I wrote a detailed how-to guide on installing Ruby and Rails on Ubuntu 10.10 that will help you with this.
Guaranteed, or your money back!
Error installing RedCloth on Rails 3.0.3 and RVM on Ubuntu 10.10
This might be related to the problem I had this morning with RedCloth.
I also installed version 4.2.6 of RedCloth, and then could not use it in a Sinatra app, no matter what I did. (I got a lot of similar errors, Uninitialized constant RedCloth
.) However, the RedCloth site (http://redcloth.org/) says the latest stable version is only 4.2.2.
I uninstalled 4.2.6 and installed 4.2.2, and it worked perfectly.
Try adding the restriction to your Gemfile, i.e. gem 'RedCloth', '4.2.2'
Installing the RoR stack in ubuntu 10
Ryan Bigg has an excellent post about this using RVM. For setting up rails, you generally want to avoid installation via aptitude.
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
Error while installing Ruby 1.9.3 on Ubuntu 10.10, with rvm
switch RVM Autolibs to read-fail
:
rvm autolibs read-fail
it will tell RVM to not install/update anything and only fail telling you what is missing for you, from here on it's your choice if you want to install the missing dependencies (most likely you do), or to ignore the dependencies and let RVM know you do not want to know that something is missing with:
rvm autolibs read-only
it will tell RVM to not install/update anything and only use what is already installed, no fail will occur, just a warning will be displayed that something is missing.
Related Topics
Find or Create Record Through Factory_Girl Association
Should I Define a Main Method in My Ruby Scripts
How to Convert a JSON Formatted Key Value Pair to Ruby Hash with Symbol as Key
Is There a Way in Ruby/Rails to Execute Code That Is in a String
Puppet/Facter "Could Not Retrieve Fact Fqdn": How to Fix or Circumvent
What Does ':Location => ...' and 'Head :Ok' Mean in the 'Respond_To' Format Statement
How Much Performance Do You Get Out a Heroku Dynos/Workers
Ruby's <=> Operator and Sort Method
Why Should I Care About Rvm's Gemset Feature When I Use Bundler
Rails 4 Error R14 on Heroku (Memory Quota Exceeded)
How to Set Ruby's Load Path Externally
How to Dump an Http Request from Within Sinatra