How do I install ruby 2.0.0 correctly on Ubuntu 12.04?
follow below steps
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p481.tar.gz
tar -xvzf ruby-2.0.0-p481.tar.gz
cd ruby-2.0.0-p481/
./configure --prefix=/usr/local
make
sudo make install
installed ruby using apt-get install ruby 2.0.0 succeeded but not using correct ruby version
If you're new to linux I'd recommend using something like RVM (Ruby Version Manager) to install ruby. It makes it easier to switch ruby versions and manage multiple gemsets.
To install RVM with the latest (stable) ruby:
\curl -L https://get.rvm.io | bash -s stable --ruby
then check which rubies are installed by using
rvm list
you can then switch ruby versions using
rvm use 2.0.0 --default
with the --default
flag overriding any system ruby.
Update
If you really don't want to use RVM, then use
sudo apt-get install checkinstall
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure
make
sudo checkinstall -y \
--pkgversion 2.0.0-p0 \
--provides "ruby-interpreter"
checkinstall
will package the source, making it easier to remove in the future
You'll then need to add the Ruby binaries to your path, by editing the env file:
sudo nano /etc/environment
add /usr/local/ruby/bin
PATH="/usr/local/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
then run
source /etc/environment
to reload the file, and check your ruby version with
ruby -v
ubuntu 12.04 ruby 2.0 rails: Could not find 'thread_safe'
Seems you are using 2.1.0 version of rubygems. It's not bug of tread_safe or atomic gems, but it's bug of rubygems 2.1.0. Try to install older version (like 2.0.8). How to do this:
gem uninstall rubygems-update
gem install rubygems-update --version 2.0.8
update_rubygems
How to install Ruby 2 on Ubuntu without RVM
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz
tar -xvzf ruby-2.0.0-p451.tar.gz
cd ruby-2.0.0-p451/
./configure --prefix=/usr/local
make
sudo make install
from here How do I install ruby 2.0.0 correctly on Ubuntu 12.04?
UPDATE
for ruby 2.1.5
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
tar -xvzf ruby-2.1.5.tar.gz
cd ruby-2.1.5/
./configure --prefix=/usr/local
make
sudo make install
if you are still seeing an older ruby check your symlink ls -la /usr/bin/ruby
from hector
Installing Ruby 2.0.0 using RVM
Your rvm is probably not up to date, and by doing so the list of installable rubies also. Rvm probably took the best match, that was Rubinius 2
When you do
rvm list known
You obtain the list of known rubies that you can install
This list is updated at the same time you update rvm. Then you need to update rvm before installing MRI Ruby 2.0.0
rvm get stable
Forbidden - Ruby 2.0.0 Rails 4.0.0 Nginx Passenger on Ubuntu 12.04
So it started to work. The weird part is that I can't really tell what caused it to start working. I've made a few mistakes along the way that I have fixed. One was adding basic auth incorrectly to the site configuration:
server {
listen 80;
root /var/www/default/public;
server_name s.dev;
location / {
auth_basic "Restricted";
auth_basic_user_file /var/www/default/.htpasswd;
passenger_enabled on; <------ did not remember to add this
}
passenger_enabled on;
rails_env development;
}
Another thing was to add a user to nginx.conf and make this user the owner of /var/www/default - although I am pretty sure that this was one of the things I've tried when things were not working
Thank you everyone for helping out
Related Topics
How to Create Symbol (Hash Key) from Association, Using New Ruby (1.9) Hash Syntax
Can You Get Db Username, Pw, Database Name in Rails
How to Get Ruby to Print a Full Backtrace Instead of a Truncated One
Uninitialized Constant "Controller Name"
How to Implement Cookie Support in Ruby Net/Http
How to Remove the String "\N" from Within a Ruby String
Directly Accessing an Instance Variable VS. Using an Accessor Method
Insecure World Writable Dir /Users/Username in Path, Mode 040777 When Running Ruby Commands
Combining Multiple Named Scopes with Or
Ruby Variable (Array) Assignment Misunderstanding (With Push Method)
Rubygems, Bundler and Rvm Confusion
What's the Best Way to Unit Test Protected & Private Methods in Ruby
When (If) to Consolidate Activerecord Migrations
Generating an Instagram- or Youtube-Like Unguessable String Id in Ruby/Activerecord