Ask A Question

Notifications

You’re not receiving notifications from this thread.

Setup Ubuntu 16.04 Xenial Xerus Discussion

Chris Oliver asked in General
Thiago Martins Thiago Martins

Don't use "ssh-keygen -t rsa", use "-t dsa", much safer and not owned by NSA.... ;-)

Reply

thanks!

Reply

PostgreSQL is now upto 9.5.2 and yet this recommends 9.3.x. Is there something actively wrong with the version in the standard Ubuntu repositories; that prompts you to go back to the PostgreSQL repositories?

Given all the JSONB goodness that arrived with 9.4.x and was enhanced with 9.5.x; this is a surprise! Am slightly puzzled and very keen to lay hands on JSONB.

Also grateful for this site and these pages especially!

Reply

Whoops, just updated that. Hard to keep all these dang version numbers up to date.

Reply

Sorry I am very new to rails development, when creating an user in postgresql I get a not connected to database error...

could not change directory to "/home/jie": Permission denied
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"?

Reply

did you get any solution for that?

Reply

Instead of this "sudo sh -c "echo 'deb http://apt.postgresql.org/p... precise-pgdg main' >", Do "sudo sh -c "echo 'deb http://apt.postgresql.org/p... xenial-pgdg main' >"

Reply

Fixed!

Reply

Ubuntu 16.04 has Ruby 2.3 in its package repository, as "ruby-full". Is there any point these days not to use that? Even if you want to use rbenv, you can still mix user gems and system ruby. (Note noobs: even though all guides seem to advise you to use rbenv or rvm, it can be more trouble than it's worth, especially on a single-user system.)

Reply

The main reason not to use that is because you can update Ruby versions independently of the packages. Ruby 2.3 will get patches, 2.4 will come out, etc and you may have older apps that use 1.9 for example. All those would be easily managed with a version manager like rbenv and you can install it without waiting for the package maintainers to update it.

Reply

You have the installing NodeJS twice. Once right after rbenv/rvm and once right before installing Rails. Is there a reason for that?

Reply

Nope, just overlooked that! :)

Reply
Anand Chavan Anand Chavan

You got great article!

Would you be able to demonstrate the same for Production Environment ? and the best practices for production ?

Reply

Check out the deploy tutorial! :) https://gorails.com/deploy/...

Reply

If I want to automate the entire set of tasks in one script and call that at command line and sit back and watch it all happen, how do I do that? Right now I am cutting and pasting lines.

Reply

That's where Chef, Ansible, etc come into play. :)

Reply
Einars vilnis Einars vilnis

Thank you very helpful

Reply

thanks man... this help-me a lot!

Reply
Paul Waweru Paul Waweru

Git connection was refusing until I ran ssh-add ~/.ssh/id_rsa and it worked.

May help somebody.

Reply
Marcelo Brantes Marcelo Brantes

I solved this problem with the two commands bellow:
1) eval `ssh-agent -c`
2) ssh-add

Reply

great!

Reply

Just curious, why not default to `rvm` ?

Reply
Dillon Burnett Dillon Burnett

not sure, but rvm did work for me a few different times, but every time i have tried rbenv it has worked.

Reply

Greate article, I always forget setting up the postgres user.

Reply
subham gupta subham gupta

rbenv install 2.3.1

Downloading ruby-2.3.1.tar.bz2...

-> https://cache.ruby-lang.org...

error: failed to download ruby-2.3.1.tar.bz2

BUILD FAILED (Ubuntu 16.04 using ruby-build 20160426-22-g3dbbf90)

can you help me in this ?

Reply
Ricardo Lopes Ricardo Lopes

When I run

sudo apt-get install postgresql-common

I got this error:
The following packages have unmet dependencies:
postgresql-common : Depends: init-system-helpers (>= 1.18~) but 1.14 is to be installed
E: Unable to correct problems, you have held broken packages.

Believe me, neither stackoverflow was able to help me with thie error.

Anyone can help?

Reply
Ricardo Lopes Ricardo Lopes

I figured out what I did wrong. I was trying to install Xenial package instead of Trusty package.
Thanks.

Reply
Sarayut Jansoda Sarayut Jansoda

Thank that all work for me.
i must learn ruby now.!

Reply
johnfisherman johnfisherman

Epic. Many thanks.

Reply
Adrian Beauregard Adrian Beauregard

I'm going into the last step rake db:create but i've got an error, it says that i have to install debug_inspector - v '0.0.2' but still ive got an error, please help me, what i supposed to do? thank you.

cahyaef@Lumos:~/myapp$ rake db:create
Could not find gem 'rails (= 4.2.6)' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.

cahyaef@Lumos:~/myapp$ bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies.............................................
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Installing debug_inspector 0.0.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/bundler20160625-27921-19vrn9zdebug_inspector-0.0.2/gems/debug_inspector-0.0.2/ext/debug_inspector
/usr/bin/ruby2.3 -r ./siteconf20160625-27921-q4iq2t.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160625-27921-19vrn9zdebug_inspector-0.0.2/gems/debug_inspector-0.0.2 for inspection.
Results logged to /tmp/bundler20160625-27921-19vrn9zdebug_inspector-0.0.2/extensions/x86-linux/2.3.0/debug_inspector-0.0.2/gem_make.out
Using bundler 1.12.5
Installing byebug 9.0.5 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/bundler20160625-27921-1av67ezbyebug-9.0.5/gems/byebug-9.0.5/ext/byebug
/usr/bin/ruby2.3 -r ./siteconf20160625-27921-10vahzy.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160625-27921-1av67ezbyebug-9.0.5/gems/byebug-9.0.5 for inspection.
Results logged to /tmp/bundler20160625-27921-1av67ezbyebug-9.0.5/extensions/x86-linux/2.3.0/byebug-9.0.5/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Installing pg 0.18.4 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/bundler20160625-27921-6wnv2wpg-0.18.4/gems/pg-0.18.4/ext
/usr/bin/ruby2.3 -r ./siteconf20160625-27921-1hfbrz5.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160625-27921-6wnv2wpg-0.18.4/gems/pg-0.18.4 for inspection.
Results logged to /tmp/bundler20160625-27921-6wnv2wpg-0.18.4/extensions/x86-linux/2.3.0/pg-0.18.4/gem_make.out
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.1
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/bundler20160625-27921-fzg6wvnokogiri-1.6.8/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160625-27921-131um77.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /tmp/bundler20160625-27921-fzg6wvnokogiri-1.6.8/gems/nokogiri-1.6.8 for inspection.
Results logged to /tmp/bundler20160625-27921-fzg6wvnokogiri-1.6.8/extensions/x86-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.

Reply

Chris, as a subscriber, I've gotten a lot of tips from you, now here's one from me:
It should be "without further ado", not "adieu." The former means fuss and bother, the latter means goodbye. The are homonyms.

Reply
Join the discussion
Create an account Log in

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

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

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