Skip to main content

Setup Ubuntu 13.10 Saucy Salamander Discussion

General • Asked by Chris Oliver

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

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


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.

i've tried today and before that, i run sudo apt-get update but not work


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.

Hey thanks for your swift reply..i have got it done working fine ...thankyou so much guys

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.

It removes logrotate and its dependencies automatically.


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.

no I installed ruby with rvm

victory! I had to add `source ~/.rvm/scripts/rvm` to .bashrc file

http://www.codelearn.org/bl...

Oh of course! Thanks for catching that. I'll make sure to update the tutorial.


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.

can you tell how to give admin right to the user?

See this for granting permission to a user inside of Postgres: http://www.cyberciti.biz/fa...


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


Hi, I got this error when entered this command:
sudo -u postgres createuser aaa -s
"could not change directory to "/root": Permission denied"

Are you a regular user or root when you ran this? I found this when googling it http://www.postgresql.org/m...

I did the whole process as root. Do I need to login as postgres user?

Ideally you want to do this as your regular user. If you're root, you can do this instead:

su postgres
createuser aaa -s

Thank but I redo the whole thing as a user (with root privileges). I am stuck at SSHing to GitHub (SSH Key is added to GitHub account).

ssh -T [email protected]
Host key verification failed.

For that to work, you need to put your ~/.ssh/id_rsa.pub key into Github.

Yes I did add key to GitHub (http://puu.sh/6rnjF.png).
It was not a problem when I did that with root but as a new user, I got this problem.


I am new to both ruby and ubuntu and am just wondering where the default directory is for the config/database.yml? Apologies in advance if its quite simple

It's located inside your Rails application. It will be generated when you run the "rails new" command.

Oh awesome, cheers! I thought that might have been the case but just wanted to see if it wasn't made in the install and I missed it.

Thanks


Great guide for a *nix n00b like me!!

Only one issue, the "add-apt-repository" stuff was reporting "command not found" so I had to search elsewhere to sort that.

But again, thanks my friend, best guide ever :)

Thanks Rich! Did you have to install the python-software-properties or software-properties-common package(s)? Also which version of ubuntu were you on? I'm surprised it didn't come with Ubuntu 13.10

Hey Chris. I had to install both the python-software-propertiesand the software-properties-common packages. It's possible I only needed one, but I forget which one I installed first so I may not have needed it. Sorry, forget which one though - but I definitely needed one of them.

I installed Rails on a clean Ubuntu 13.10 x64 Server edition (no X).

Thanks again, without this guide I wouldn't now be running my own Diaspora* pod :)

Fantastic. :) Thanks for the tip. I'll make sure to get that fixed shortly.


if i copy a new rails app and then cd in and type bundle install, it says "The program 'bundle' is currently not installed. You can install it by typing:

sudo apt-get install ruby-bundler"

how can i get it work.
infact doing rails on a new folder says i got to install rails using"sudo apt-get install rails". why like this?
(things were easier with windows)

okay it seems i did all this in a new tab wch was causing it to behave that way. but i got reasons to believe when i start my comp the next time, that's what i will get when i try starting the app.


Setting up LAMP, PHP, and Ruby/Rails on an Amazon EC2 instance, running Ubuntu:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.10
Release: 13.10
Codename: saucy

so this is cool. Installing liquid template (Shopify's templating language / framework), drupal, wordpress, and other options. Be fun to set up an old-skool slash-dot server maybe later.

Sound interesting to anyone? If so I'll post my ongoing results here. So far -- stumbles over Amazon's documentation on getting started... but once you have your instance up, everything is straight out of the web, As Amazon claims, it is like having the server in front of you, So (not to beat a dead horce here) It is as if I have my work server here on my coffee table which works for me!
Oh yeah my micro-instance is free for 12 months while I try to do something with it ;)

Sure! I'd love to hear how it goes.

Well I actually got a couple of small paid contracts to work on! So I am setting this aside for a bit. I will be getting back to it however. I'll post back to here.


You should have told us how to click "Ok" in terminal. :D


Hi Chris, thanks for the tutorial. I'm new to ruby on rails and is currently trying to set it up on ubuntu 13.10. I've gotten as far as setting up the postgresql but i keep getting this:

try wget --help for more options
gpg: no valid open PGP data found

after typing :

sudo sh -c "echo 'deb http://apt.postgresql.org/p... precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/p... | sudo apt-key add -

What do i do?

You're welcome! Make sure you run the wget command exactly as it is written. Missing a "- " can cause it to fail. If you need to, download the file yourself, and run

sudo apt-key add ACCC4CF8.asc

where ever you download it to.

Thanks, didn't type it in properly.


Hey thanks for posting this! I set up a user with full permissions on my Linode VPS and then disabled root access for security reasons. Maybe for that reason I am getting "rbenv not found" after I type "rbenv install 2.1.0". Any ideas?

If you're getting rbenv not found, then go back and run the echo lines to make sure that rbenv is added to your user's bashrc. That's what makes rbenv and all the rubies you install available to that user.

Thanks for pointing me in the right direction. Sorry, I'm quite a newbie when it comes to using a server of any kind so it's not too obvious for me... ;-)

You may want to walk through the whole rbenv installation again just to make sure it's setup right.

It worked, thanks!

In case anyone finds this useful, I set up my user as follows at the start:

adduser example_user_name
usermod -a -G sudo example_user_name


Thanks for this great article. I'm a newbie and moving pretty slowly in getting the environment set up, so this really helps. At this point, it looks like I have Ruby and Rails installed, I've set up myapp and done the "rails server" command at the end, but the http://localhost:3000 doesn't show me anything ("Problem loading page" message). Do you have any idea what might be wrong? Thanks!

Make sure the rails server command is still running. The command will say it is listening on http://0.0.0.0:3000 which means it's running successfully.


Fernando Rosentalski

Nice post, you could improve adding imagemagick or graphicsmagick as well


How to install script on apache2 ubuntu 13.10


Rails setup has never been easier! Well done mate - you are legendary!


very cool, big thanks!


when i restart terminal it doesn't see ruby anymore :(

Make sure your ~/.bashrc has the export PATH lines in it for rbenv or rvm (whichever you were using).


This is the very cool every, Thanks for your nice tuts.


Everything worked fine until I tried to add test the website (http://localhost:3000). I received an error that stated "no Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb). I ran a trace, but it seems that everything else loaded properly. Do I need to add the rakefile?

Hey Rico, there should be a Rakefile automatically generated when you create your rails app. What command were you running that gave this error?

Hey Chris. I ran the command "rake db:create"

Okay cool, so make sure you're inside the rails application when you run that command.


Eduardo D Jr Barrete

Hi Chris,

I have this error : No binary rubies available for: ubuntu/13.10/i386/ruby-2.1.0.

Hey Eduardo, I believe that is rvm telling you that you don't have all the necessary to compile from source so it is looking for a binary instead. Double check that you installed all the packages with apt-get and the other parts of the tutorial before that.

Eduardo D Jr Barrete

Hi Chris thanks for your reply. I just reinstalled my ubuntu and now its working fine. Thanks again!


Thanks for that!



Very helpful guide. Works on my ubuntu 13.10. Thanks!


Awesome! Many thanks, Chris


Kasey Jean Robinson

This worked great, thank you so much!!!

I had a little trouble on how to save the git SSH key to a /home/user/ folder, but figured it out with a friend's help. Thanks!

Great! Let me know if there's anything I can make more clear for that part.


Geez, wish I'd seen this when I was setting up Ruby & RoR on Ubuntu. What is the reason for installing node.js? I've noticed I always have to install the ruby racer for JS stuff, but I don't on our work server. At work we have node.js installed. Does node.js provide JS abilities (if that's the right word) for process .js files?

The ruby racer can be a replacement for Node.js but Node doesn't require you to add a gem to your app. The reason you need one of these is so that you can compile Coffeescript to Javascript (and then combine and minify it in the asset pipeline when you deploy). Node is a Javascript runtime that isn't in the browser and therubyracer gem provides one as well.

Thanks, that's great to know. I'll add node.js and remove the ruby racer gem. BTW, I really like the way you structured this page with the various version at the top, and the tabs for whatever Ruby management tool we use.

I was hoping people would find those useful! :)


Chris - 'setup' is a noun, and 'set up' is a verb, and you've misused 'setup' in this article, in other articles you've written on gorails.com, and in replies to this article. Please take a few minutes to learn the correct the usage of 'set up' and 'setup'.


Thank you!
Great Job


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 18,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.