Setup Ubuntu 14.04 Trusty Tahr Discussion
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
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.
when i try [ rvm --default use 2.1.1 ] this happens RVM is not a function, selecting rubies with 'rvm use ..' will not work.
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.
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.
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.
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.
Why on sites which are pleasant to me there are no social buttons with "like buttons"? Good guide, thanks.
Thanks Chris, this is just what I was looking for to get my development server up and running.
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?
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.
$ 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?
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Did you install the OpenSSL lib with apt-get?
Great article! Note: I needed to move .bashrc entries to .zshrc, so everthing worked like a charm.
(https://github.com/sstephen...
Great article! Note: I needed to move .bashrc entries to .zshrc, then everything worked like a charm.
(https://github.com/sstephen...
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...
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/
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.
Thanks John. That *should* be fixed in Ruby 2.1.2. Is that what you were installing?
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.