Ask A Question

Notifications

You’re not receiving notifications from this thread.

Setup Ubuntu 14.04 Trusty Tahr Discussion

Chris Oliver asked in General
Kelvin Knighton Kelvin Knighton

this version of ruby has been hunting me, 1.9.3p484: first i had rbenv but i did alot of stuff with that included installing 2.1.2 and i put ruby -v and 1.9.3 pops up, i dealt with that all day yesterday and alot today, just 30 mins ago i unstalled rbenv and install rvm and install 2.1.2 and still 1.9.3p484 pops up, i would really be thankful for any advice you could give me on this

Reply

If you have multiple versions of ruby, you'll want to set the default (or use rbenv/rvm to switch). For me, I have 1.8.7, 1.9.3, 2.0, and 2.1 installed on my machine. I set 2.1.2 as the default, but certain applications switch back to 1.9 and 1.8.7 for me.

I'd guess you just haven't set the default to 2.1.2 yet and that's what is missing.

Reply

when i try [ rvm --default use 2.1.1 ] this happens RVM is not a function, selecting rubies with 'rvm use ..' will not work.

Reply

Take a look at this: http://stackoverflow.com/qu...

Reply
Shaun Stanislaus Shaun Stanislaus

i couldn't install it. can someone help me out?

shaun@ubuntu:~$ rvm install ruby-2.1.2
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/14.04/x86_64/ruby-2.1.2.
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.1.2',
showing last 15 lines of /home/shaun/.rvm/log/1402160742_ruby-2.1.2/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.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list

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

Reply

Does sudo apt-get update work? It's saying something is wrong with that.

Reply

I'm having this same problem does anyone have a solid solution for this error?

Reply

You see this because of your apt-get update fail to update some packages. If there is any failure in your apt-get update the install rvm is not working. So you have to fix all the failures in apt-get update command.

Solution :-
remove 3rd party packages give 404 error in update.
sudo add-apt-repository --remove <package-name>

do this there is not error in apt-get update.
then install the rvm

I think this will help to solve the problem.

Reply

At some point an article on installing and using nginx and passenger would be great:-)

Reply
Reply
Steve Metzger Steve Metzger

Chris, get setup ...it worked well..... but maybe i placed myapp in the wrong location. Its in /home/ubuntu/myapp. I cannot ping 127.0.0.1:3000 and cannot access the Ubuntu AMI externally. Rails server ran successfully on port 3000. Thanks for any ideas.

Reply

Hey Steve, this setup is primarily for development. On a production AMI on AWS you probably want to run a server like Passenger so that it can serve up the app on port 80. This tutorial might be more what you're looking for https://gorails.com/deploy/...

If you're wanting to do development on AWS though, you probably just need to open up port 3000 in your security group because I can bet the firewall is blocking it.

Reply

Why on sites which are pleasant to me there are no social buttons with "like buttons"? Good guide, thanks.

Reply

Ahhh, missed at the end of page.

Reply
Mark Railton Mark Railton

Thanks Chris, this is just what I was looking for to get my development server up and running.

Reply

Great post! Thanks. A tweet button would be nice.

Reply

Thanks for the tutorial, it all worked, got only one problem. I need to have root privileges to create new app (or even check rails version). When I try creating new app as normal user I get error:
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
* ruby-railties-4.0
Is there way to change that, so I wouldn't have to be constantly logged in as root while working on my projects?

Reply

If you used rbenv, make sure you run rbenv rehash after installing the Rails gem. That makes the gem's executables available to use. It currently isn't available, so Ubuntu is suggesting a different installation method.

Reply

Great! Thanks

Reply

$ rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudf...
Installing ruby-2.1.2...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20140711233341.7690
Results logged to /tmp/ruby-build.20140711233341.7690.log
Last 10 log lines:
io-console 0.4.2
json 1.8.1
minitest 4.7.5
psych 2.0.5
rake 10.1.0
rdoc 4.1.0
test-unit 2.1.2.0
installing rdoc: /home/codemilan/.rbenv/versions/2.1.2/share/ri/2.1.0/system
installing capi-docs: /home/codemilan/.rbenv/versions/2.1.2/share/doc/ruby
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Reply

The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Did you install the OpenSSL lib with apt-get?

Reply

Great article! Note: I needed to move .bashrc entries to .zshrc, so everthing worked like a charm.
(https://github.com/sstephen...

Reply

Great article! Note: I needed to move .bashrc entries to .zshrc, then everything worked like a charm.
(https://github.com/sstephen...

Reply
Thiago Colares Thiago Colares

Great article! Notice for zhs user when installing by using rbenv: I needed to move .bashrc entries to .zshrc, then everything worked like a charm. https://github.com/sstephen...

Reply

Change the rvm installation command for

\curl -sSL https://get.rvm.io | bash -s stable
If you want an all-in-one installation, try pass the --rails argument after "stable".
Source:
http://rvm.io/

Reply

Awesome - worked like a charm on Ubuntu 14.04!

Reply
John Creamer John Creamer

Very helpful. I did get hung up at one point with a failed ruby build in rbenv, apparently related to readline bug. This was fixed by running a patch per https://github.com/sstephen... where I substituted my ruby version for the one listed.

Reply

Thanks John. That *should* be fixed in Ruby 2.1.2. Is that what you were installing?

Reply
George Labuschagne George Labuschagne

Thanks, great post.

Reply

Unbelievable!!!! Finally a guide that works with no gotchas.... Thanks heaps

Reply

Thank you for a wonderful tutorial! Too many of the instructions you find about rails nowadays are from several years ago and aren't the best practices.

Reply
Join the discussion
Create an account Log in

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

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

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