Ruby 2.0 on Mac 10.5.8 via RVM - rvm

I have been having some issues with my Ruby and Gem environments and wanted to clean them all out and start over. So I removed all my ruby's in rvm (rvm 1.13.8 (stable)) which left me with the stock Ruby 1.8.6 and Gem 1.0.1. I thought about removing these as well but everything I read said they should be fine. Anyway I went to install Ruby 2.0 but RVM has 1.9.3 as the most current and I was wondering if its because I am running 10.5.8 on a G4 MDD and if there is a possibility of being able to install it. My MacBook Pro running 10.8 was able to install it.
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p358]
[ruby-]1.8.7-head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3-[p194]
[ruby-]1.9.3-head
ruby-head

You need to update RVM, the versions are part of the update:
rvm get head
rvm list known | grep 2.0.0
which gives:
[ruby-]2.0.0-rc1
[ruby-]2.0.0-rc2
[ruby-]2.0.0[-p0]
rbx-2.0.0-rc1

Related

YAML safe loading is not available

When I want to install compass with gem install compass, I occurred with this error:
YAML safe loading is not available.
Please upgrade psych to a version that supports safe loading (>= 2.0).
what The cause of this error and how can I solve the problem?
It sounds like the psych gem needs to be updated. Try running gem install psych and then gem update psych.
Suggested by looking at the psych readme file here: https://github.com/ruby/psych/blob/master/README.md
EDIT: you might also have to update your version of ruby. This depends on how you have installed ruby, but #ewerx has one suggestion in their answer.
To resolve this I first upgraded Ruby from 2.0.x to 2.4.2 (https://gorails.com/setup/osx/10.12-sierra):
rbenv install 2.4.2;
rbenv global 2.4.2
Then updated gems:
sudo gem update --system;
gem update
It may be sufficient to just update gems.
The following part of the post on https://gorails.com/setup/osx/10.12-sierra solved my issue.
We will be setting up a Ruby on Rails development environment on macOS 10.12 Sierra.
Older versions of OS X are mostly compatible so follow along as far as you can and then Google search for any problems you run into. There are plenty of people who have documented solutions for them.
Installing Homebrew
First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.
Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.
Open Terminal and run the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Ruby
Choose the version of Ruby you want to install:
Now that we have Homebrew installed, we can use it to install Ruby.
We're going to use rbenv to install and manage our Ruby versions.
To do this, run the following commands in your Terminal:
brew install rbenv ruby-build
Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
Install Ruby
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v

Installing Rails 3.2.8 into Solaris 11

I'm trying to create a virtual machine with Solaris 11 running Rails 3.2.8. Is there a tutorial or script for that?
Seems like Solaris 11 is distinctly lacking some items that you could almost say are essentials for newer versions of Ruby. And I hear the cries from the Oracle faithful that they are shipping Ruby! Hmm version 1.8 of Ruby and it's nearly 5 years old and only months away from EOL.
So what do you need todo is to build ruby 1.9.3-p125 on Solaris 11, via compiler obviously and I'm using the latest gcc that are included in the Solaris 11 repo. Don't forget to install libyaml too, otherwise we end by with annoying message.
Start with installing libyaml:
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
sudo make install
Pretty straight forward no issues.
Installing Ruby 1.9.3-p125 (newer versions does work for me)
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar xzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
./configure --enable-shared --with-opt-dir=/usr/local/lib
make
sudo make install
Notice that libyaml couldn't be found without specifying ---with-opt-dir
ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-solaris2.11]
gem -v
1.8.11
sudo install rails
This might not be the right way to solve the installation for Ruby on Rails on Solaris I'm a developer not a system administrator.

Not able to update ruby version from 1.8.7 to 1.9.2 using rvm

I am new to ruby programming and want to update ruby from 1.8.7 to 1.9.2. I have followed some steps from different sources but not able to get required result
the sequence of steps are given below
#apt-get install ruby-rvm
#rvm remove 1.8.7
#rvm install 1.9.2
#rvm use 1.9.2
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p290
after that when i fire #ruby -v, then also it gives the result as given below
#ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
Please guide me with specific solution
I am using ubuntu 11.10 beta
you have two installations of rvm, and one of them is broken, please use this answer: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

I can't seem to get rails installed on my Mac (10.6.5). Following Ruby on Rails Tutorial 3

I'm trying to get Rails 3 up and running by following the steps outlined in "Ruby on Rails Tutorial" by Michael Hartl (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book).
The details start in section 1.2.2 (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:rubygems). Here you go through the following steps:
Installing Git
Installing Ruby (version 1.9.2) using Ruby Version Manager (RVM)
Creating different gemsets for environments using Ruby 1.8.7 and 1.9.2
Installing RubyGems
and finally, installing Rails.
I run the following command [sudo] gem install rails --version 3.0.7
Everything seemed to install correctly (based on no errors). However, when I type "rails -v", rails cannot be found.
I am a Rails newbie. I'm trying to install Rails on a machine running Mac OS X 10.6.7.
Thanks.
If you are using RVM you probably don't want to use sudo when installing gems. If you have Git installed only steps needed to get Rails are:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.zshrc
# Reload your shell now (open a new terminal for example)
rvm install 1.9.2
rvm 1.9.2 --default
gem install rails --version 3.0.7
hash -r
This skips the gemsets part (you don't need it if you are just starting learning Rails) and assumes that you use Zsh (I think it's Mac OS X default, if you use Bash then you have to alter .bashrc, not .zshrc).
If you want to remove your previous installation and start over use rvm implode.

Rails 3: Ruby 1.9.2: does it need /usr/bin/ruby1.8?

I am trying to get the Rails tutorial by Michael Hartl going. I spent a lot of time fighting various libraries. So I removed all ruby software from my Ubuntu 10.4 system.
Then I installed Ruby 1.9.2.
$ ruby -v
ruby 1.9.2dev (2010-07-02) [i486-linux]
So far so good. Then I did
sudo gem install rails
After a long time, it finished the installation.
Then I ran
$ rails -v
bash: /usr/bin/rails: /usr/bin/ruby1.8: bad interpreter: No such file or directory
So...I have no /usr/bin/ruby1.8 on my system. How do I get Rails 3.0.3 to use my ruby at /usr/bin/ruby?
I appreciate any help you can give me.
Just to see if I could keep going, I tried
$ cd /usr/bin
$ sudo ln -s ruby1.9.2 ruby1.8
This let me keep going, but is it the right thing to do?
It took trying 3 different methods of installing and uninstalling Ruby, but I finally got it!
I found a great tutorial by Toran Billups which gives some great instructions. After analyzing what he did, it comes down to a few key concepts:
Some libraries that are independent of the Ruby version must be installed in the system (using "sudo apt-get").
Use RVM to install Ruby in your own account. i.e. no "sudo".
Use gem to install gems in your particular ruby environment. (i.e. no "sudo"). When you set 1.8 as the Ruby environment, the gems are installed in the RVM 1.8 tree in your environment. When you set 1.9.2 as the environment, gems are installed in the 1.9.2 tree in your environment.
Here, then, is the process.
Remove all Ruby programs (1.8.x and 1.9.2) and Ruby libraries from your Ubuntu 10.4 system.
Install RVM on your system, following the instructions at the RVM site(broken) RVM site.
Follow Toran Billups' tutorial, starting at the point where you install Ruby 1.8.7.
Follow the instructions at Michael Hartl's tutorial(broken) Michael Hartl's tutorial to get Rails 3.0 working with Ruby 1.9.2, github, heroku.com, rspec, spork, and autotest.
I had the same error after installing with RVM and opening new shells. The solution was to run:
$ rvm use 1.9.2 --default
P.S.
I'm running Ubuntu 10.04 and after two days of trial and error finally got rails 3 working with ruby 1.9.2. I highly recommend using RVM to install ruby a godsend!
By the sounds of it Bash is finding ruby1.8 when its running the #!/usr/bin/env ruby line from the rails script, even though it doesn't exist. Try /usr/bin/env which ruby to see exactly what interpreter it's trying to load.
I was also having a headache with this, and don't want to use RVM right now.
I saw that the shebang line for /usr/bin/gem was #!/usr/bin/ruby1.8 and that this was presumably the issue.
I made sure /etc/alternatives pointed to the correct gem script; this can be set with:
update-alternatives --config gem
Then I removed /usr/bin/gem and symlinked from /usr/bin/gem to /etc/alternatives/gem
It turns out the only difference in the gem scripts was the shebang line, so manually changing that would have worked too.
Solved by changing back the version of my current Ruby (using RVM) to 2.0.x.
When i installed rails (two days ago) it was under the 2.0.0 version. Yesterday i changed to 2.1.x. Today i tried the rails command and got the error.
So turning back to the RVM Ruby version i installed rails did the trick.
Sorry by the bad english.
P.S. Using Ubuntu 13.10