Ask A Question


You’re not receiving notifications from this thread.

Setup Ruby On Rails on Ubuntu 15.10 Wily Werewolf

Chris Oliver asked in General
Bruno Paulino Bruno Paulino

Thanks for this amazing tutorial! you just described every step!


Thanks! It's helpful to me.


Likely that if you are using Ruby version 2.2.3 with RVM is bound to have problems when installing libraries that require installing native extensions. For some reason (IDK if because the RVM's ruby binary is not correctly compiled), when installing ruby 2.2.3 you'll run into that kind of problems.

The solution I found was installing from source (i.e you compile and install ruby locally on your machine).
To accomplish this do the following:

1. Install Ruby 2.2.3 normally with RVM ("rvm install 2.2.3; rvm use 2.2.3")
2. Once installed issue the command "rvm reinstall 2.2.3 --disable-binary"

Another solution is to fallback to a previous version such as 2.2.2 or 2.2.1

This may be helpful if you run into this problem.



For those who have trouble installing PostgreSQL part on Kubuntu 15.10 :

// remove all installation of postgre first
$ sudo apt-get purge postgresql*

// try changing <precise-pgdg> into <wily-pgdg> on apt sources
$ sudo sh -c "echo 'deb wily-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

// install latest version of PostgreSQL (9.4 as it written)
$ sudo apt-get install postgresql libpq-dev


When I do rbenv install 2.2.3 command I get the error: zsh: command not found: rbenv, I am doing the 15.10 install


zsh is probably not there. Try 'sudo apt-get install zsh'


It's because the install above is for bash shell... You will need to replace... ~/.bashrc with.... ~/.zshrc

Like so...

git clone git:// .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
exec $SHELL

git clone git:// ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
exec $SHELL

git clone ~/.rbenv/plugins/rbenv-gem-rehash

rbenv install 2.2.3
rbenv global 2.2.3
ruby -v


I should talk to Ruby On Rails community and include your rails installation guides on the official website.


I would love that! :)


Awesome easy to follow guide! Enabled me to put Ruby on my server without issue!


W: Failed to fetch 404 Not Found

W: Failed to fetch 404 Not Found

Now What ?


That repository is outdated. Instead use the official one:

//Remove the old repository
add-apt-repository -y -r ppa:chris-lea/node.js
rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list

//Add the new official repository - Disqus hides the full url, so make sure it's correct:
curl -sL | sudo -E bash -

//Update repositories
sudo apt-get update

//Install nodejs
sudo apt-get install nodejs

Eduardo Wichoski Eduardo Wichoski

I get this error when i try to create the PostgreSQL user:

createuser: could not connect to database postgres: could not connect to server: No such file or directory

Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

--- EDIT ---

I used "/etc/init.d/postgresql start", then worked.


Thank you !! Got the same error as you mentioned and your solution worked like a charm :)


How do you change the domain socket?

André Meireles André Meireles

Thank you very much.
Rails on Linux Mint 17.3 is up and running!

Carlos Pinochet Carlos Pinochet

Hi Andrés, did you install it under root session or under other user?


please update --no-ri --no-rdoc is deprecated, change it to --no-document


When I goto localhost:3000 I get this error:

raise Gem::LoadError, "Specified '#{spec[:adapter]}' for database adapter, but the gem is not loaded. Add `gem '#{}'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord)."

Not sure what needs to be done.


Having some issues getting the rvm install 2.2.3 to work.. getting this any idea how to fix?

gh0st@gh0st-Latitude-E7440:~$ rvm install ruby-2.2.3
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/15.10/x86_64/ruby-2.2.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system.................
Error running 'requirements_debian_update_system ruby-2.2.3',
showing last 15 lines of /home/gh0st/.rvm/log/1452785849_ruby-2.2.3/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:
There has been error while updating 'apt-get', please give it some time and try again later.
404 errors should be fixed for rvm to proceed. Check your sources configured in:

++ return 100
Requirements installation failed with status: 100.


I just had the same kind off problems

Your rvm running 'apt-get upgrade' command, you see. Try running the command yourself and see if there any 404 error. There is. Just remove repos that gives you the error with 'sudo add-apt-repository -- remove ppa:whatever/name' and you are good to go!

Even rvm says you to fix it or comment it out! Hope someone will find it useful

Junaid Farooq Junaid Farooq

Sir why you recommended rbenv?


I did all the steps above successfully. However, when launching http://localhost:3000 I get the following error:

Unable to connect
Firefox can't establish a connection to the server at localhost:3000.

Please let me know how to fix it.


Ops, I forgot to create the database and start the server as indicated below. It's working now. Thanks for the great tutorial.

# Create the database
rake db:create

rails server

deepanshu sharma deepanshu sharma

Getting error while installing rails as follows:-

gem install rails -v 4.2.4
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/home/deepanshu/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20160223-5276-sd5elf.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.


Great tutorials. Many thanks.

Nyoman, Bali, Indonesia


How start using MySQL in Ruby on Rails?

I created a new app, using this command "

rails new myapp -d mysql

" as suggested, with no problem.

I setup the database by adding the password and run the server.

But it failed.

Any body can help?



I struggled a bit with setting up PostgreSQL, but finally got everything running. Thank you!!

Edwin Ramirez Edwin Ramirez

Great article, very detailed and very helpful.
Just one thing. I had to change my Gemfile so it didn't use the lastest version of Mysql2> gem 'mysql2', '~> 0.3.18'

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,168+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.