New Discussion

Notifications

You’re not receiving notifications from this thread.

Discussion

Join the discussion
Create an account Log in

I believe in the line "sudo apt-get install postgresql-common -t raring," raring should actually be saucy. Also in the line "rails new myapp -d postgres," postgres should be postgresql.

Fixed! Thanks for pointing those out Abe.

Thanks for the tutorial, I think in case you installed ruby from source, you will need to execute the "gem install rails" command using sudo, to be like this: "sudo gem install rails" :)

Yes! That is correct. I'll try to update the tutorial soon to note that. Thanks!

Ricardo Enrique Berdejö Mora Ricardo Enrique Berdejö Mora

Thank you. I just moved ubuntu from Win8 and didn't know how to do it.

Caio Ribeiro Pereira Caio Ribeiro Pereira

Thanks! Awesome post! I'm using into my vagrant ubuntu 13.10 now!

all this packages are exists in ubuntu 13.10 ? When I try to apt-get on them, my ubuntu doesnt find this packages : sudo apt-get install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev
libxml2-dev libxslt1-dev

Try running sudo apt-get update and then the install again. Maybe your repository list is out of date.

Daniel Alvarenga Lima Daniel Alvarenga Lima

Before gem install rails:
rbenv rehash
rbenv global 2.0.0-p247

Unable to locate package lib is what i get when I run
"

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev lib
"

Sorry, there's word wrapping there. Those two lines are meant to be one.

I fixed the wrapping so everything is on one line now! :)

Admired the way you explained it. Super cool. Very well done.

Just a minor gripe: I tried to install postgres-9.3 as i was using 9.1 on saucy. The problem is it automatically removes the package logrotate and the packages that depend on them. In my case it removed riak (basho.com) and is needed for my work. You can add a warning in the 9.3 install and ask users to wait till Trusty tahr (or) use the default 9.1 bundle.

Thanks for pointing that out. I wonder why it removes logrotate...That's definitely something you want to keep around unless they have a replacement.

If you have gem uglifier in your Gemfile, then you don't need to install nodejs.

I have a problem installing rails following the instructions:

$ gem install rails
Successfully installed rails-4.0.1
Parsing documentation for rails-4.0.1
Done installing documentation for rails after 1 seconds
1 gem installed
$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails

little help?

Did you install ruby with rbenv? If so, you need to run rbenv rehash to make the executable available.

sebastian garcia sebastian garcia

Excellent explanation! Thank you very much

First of all, thanks for the tutorial.

Secondly I run into a problem while trying to create my database.

I used your instructions to create my own postgres user but apparently I receive this error when I run rake db:create :

Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"appname_development", "pool"=>5, "username"=>"myusername", "password"=>"mypassword", "host"=>"localhost", "port"=>5432}

where myusername and mypassword are the ones I used to create my postgres user after configuring the database.yml file.

I then tried to see if the user is in the pg_roles database( http://ideone.com/HkDoXO ) and I tried to change the password in the console and restarted the server but I still got the error.

The only way I managed to make rake db:create work was to use the "postgres" user ( and I think this one was created by postgresql automatically).

You may want to make sure that the user you created has admin rights to create databases. That could be the problem as it looks like only the postgres user has "Create DB" permissions.

When i run gem install rails, I receive this error message:

ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

Can you help me to overtake this issue? Thanks you.

Make sure you installed all the dependencies. The native extensions it needs to build are likely the sqlite3 ones.

This is awesome Chris, I did a search for installing "ruby on rails ubuntu" and it popped up with a link and your image next to it. I've been staying up to date with the rails eco system and have built a few niche websites using rails but I"m glad to see you're still going strong.

Woah, I'm way late on this. Good hearing from you again! Where are you at these days?

you forgot to add nodejs package, a fundamental dependency to start webrick on ubuntu

It's in there at the top of the Installing Rails section. :)

Thanks a million! This process isn't exactly intuitive for someone who is just starting to learn Rails development, which is funny because starting Django on Ubuntu was a piece of the proverbial cake. Why the heck doesn't the Ubuntu team get their act together and make this just as easy?

Hi Chris,
Thanks for this awesome guide.
I am facing problem for installing postgres sql,
its saying:
Package postgresql-9.2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'postgresql-9.2' has no installation candidate

Try using "postgresql-9.3" instead of 9.2. It's been a little while that 9.3 has been out so the repository may have removed support for the older version. If that works, let me know and I'll make sure to update the tutorial. I'll try to get time to run through the tutorial again on my own to verify anything else that's broken. Thanks! :)

Creating a new user in postgres did not provide the necessary permissions to create a database with "rake db:create." Perhaps modify it to make the user a superuser (-su) or explain how to alter the user role with "ALTER ROLE chris CREATEDB;"

Yes, I think it used to ask before if you wanted to create a superuser but when I tried it again it didn't. Updated the instructions to include "-s". Thanks!

thanks for your info.....bravo ubuntu 13.10 by achek LPMP-Aceh

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.