Setup Ubuntu 13.10 Saucy Salamander Discussion
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!
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.
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! :)
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.
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.
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!
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 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.
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
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)
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.
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.
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 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.
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).
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?
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.
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.
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'.