0

So here is what happened: I started working for a company and was given a macbook pro for work. I do customer support for Exceptional/Airbrake so i need to learn Ruby/Rails. So the laptop had a previous owner and i dont know what he did with it.

I tried to install Ruby and Rails and kept getting errors, then tried doing it with rvm, and i thought it was working as i could run irb and even execute a test program with ruby. I got tired of seeing the previous owners name on the command line so i changed the home folder and I am pretty sure this is where things got bad. I took the contents of rvm and everything and moved it to my User file from the old one then deleted the old one.

Everything seemed to still be working fine, but when I wanted to start working with rails as well, t it wouldnt work.So i figured i would just uninstall everything and start over, i tried rvm implode and removed all gems. when i run 'gem list', i get empty, and i cant find ruby anywhere but when i run irb, it still works. so i tried re-installing using rvm, but i keep getting errors.

The first error that occurs is:

No binary rubies available for: osx/10.7/x86_64/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.

the second error is:

Error running 'env GEM_PATH=/Users/robertmroz/.rvm/gems/ruby-2.0.0-p0:/Users/robertmroz/.rvm/gems/ruby-2.0.0-p0@global:/Users/robertmroz/.rvm/gems/ruby-2.0.0-p0:/Users/robertmroz/.rvm/gems/ruby-2.0.0-p0@global GEM_HOME=/Users/robertmroz/.rvm/gems/ruby-2.0.0-p0 /Users/robertmroz/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /Users/robertmroz/.rvm/src/rubygems-2.0.3/setup.rb', please read /Users/robertmroz/.rvm/log/ruby-2.0.0-p0/rubygems.install.log

and the last error is:

ERROR:  Loading command: install (LoadError)
cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

I have gone through dozens of google searches, most of them leading me here, on each of these errors, and sometimes the certain error seems to be fixed, but in the end i cant get it to work. Should i just wipe the OS and start over, cause I have been trying to get this done for days now.

BTW, i dont know why it is installing 2.0.0 i thought rvm installed the latest version by default.

Robert
  • 35
  • 7
  • 1
    I had all kinds of problems installing ruby 2.0.0 the other day, but finally got it working. Do you use macports or homebrew, or neither? What does `rvm requirements` say? Since ruby 2.0.0 is new, I think rvm just needs time for issues to surface so it can stabilise. If you're not precious about 2.0.0, you could just install 1.9.3, and then upgrade when rvm is a bit more stable. – Sam Peacey Mar 13 '13 at 06:50
  • 'rvm requirements' gives me nothing, but i now have 1.9.3 installed, but when i run 'rvm install rails' i get 'Unrecognized command line argument: 'rails' ( see: 'rvm usage' )' – Robert Mar 13 '13 at 07:11
  • Just use bundler to install rails - from within the project directory `bundle update rails`. – Sam Peacey Mar 13 '13 at 07:21
  • i do not have a project yet, i simply have a ruby program that i converted from c that i used in class, but i plan to make it my first project. what does `\curl -L https://get.rvm.io | bash -s stable --rails` do then – Robert Mar 13 '13 at 07:27
  • In that case, just run `gem install rails`. The curl command will just install the latest stable release of rvm with rails. – Sam Peacey Mar 13 '13 at 07:49
  • What I am going to say may be insignificant but have you got x-code installed on your mac? Also What version are you trying to install?Is it Ruby 2.0.0 or earlier version? For Installing on Ruby 2.0.0 try doing this. `rvm get head`, `rvm install 2.0.0 --with-gcc=gcc-4.2` and do `sudo gem install rails` (2 Nd 3rd command will install ruby and rails). – RajG Mar 13 '13 at 15:20

3 Answers3

3

Before you blow out the system I'd:

  1. Uninstall rvm (rvm implode, gem uninstall rvm) see this question
  2. You should be left with just the base ruby. That should be the only one left.
  3. Re-install rvm (\curl -L https://get.rvm.io without Rails).
  4. Install the ruby version you want with rvm (rvm install 1.9.2) stay away from 2.0 for now.
  5. Make sure your ruby version is installed and selected.
  6. Install the rails version you want.

Hopefully that will straighten things out.

Community
  • 1
  • 1
Richard Brown
  • 11,346
  • 4
  • 32
  • 43
  • i din't realize it was 2.0.0, for some reason i was thing that was hella old or something. So ihave 1.9.3 installed, when i run rvm install rails, i get Unrecognized command line argument: 'rails' ( see: 'rvm usage' ) – Robert Mar 13 '13 at 07:09
  • It's `gem install rails` to install the latest rails version. Or `gem install rails -v 3.2.12` for a specific version. – Richard Brown Mar 13 '13 at 11:28
1

I also suffered from the same problems while installing Ruby , but after googling a lot I found the solution . Follow the below process :

  1. If you have already installed anything uninstall all of that using Revo installer or by some other means , else go to step 2.
  2. Next go to http://rubyinstaller.org/ and press the download button .
  3. You will find a list of ruby versions , click on the latest version ( If you are running a 64 bit machine install the link with (x-64) else install the one without brackets .
  4. Accept all the defaults and tick all the check boxes after downloading and setting it up , it will install in C:\ with name Ruby22 ( depending on its version )
  5. Go to start menu type cmd , the use the command "cd C:\" without brackets , it will take you the C:\ drive
  6. Check ruby -v , you should get the version number , else repeat the above process again .
  7. Now use the command "gem install rails" , it will install all the rails requirements , this takes a lot of time .
  8. Now use the command "gem install webrick" to install the web server
  9. Now go to some browser , visit http://rubyinstaller.org/downloads/ , download the DevKit at the bottom of the page and extract it to some folder ( ex in C:\DevKit after creating the DevKit folder in C:\ )
  10. Use the following commands in the same order
    "ruby dk.rb init"
    "ruby dk.rb install" "gem install rdiscount --platform=ruby"
  11. Rails is installed now .
  12. Create a folder in C:\ for creating your rails apps and name the folder ( ex Rails _Apps ) use the command cd C:\Rails_apps to go there and use the command "rails new sample_rails_app" to create a Rails app with the name "sample_rails_app" .
  13. It does a bunch of things and you are now able to use Ruby on Rails.
Pinkoo
  • 127
  • 7
0

Ruby 2.0.0-p0 was recently released, so that is the latest version technically, although I kind of doubt you really want the latest version since it is so new and your company may still be running an older version like 1.9.3. Have you tried installing 1.9.3-p392 (the current 1.9.3 version)?

If you still get the error with 1.9.3, I would try the instructions shown on the RVM site:

$ rvm pkg install openssl
$ rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr
Stuart M
  • 11,458
  • 6
  • 45
  • 59
  • okay, so 1.9.3 is installed, but when i run rvm install rails i get Unrecognized command line argument: 'rails' ( see: 'rvm usage' ) – Robert Mar 13 '13 at 07:10
  • Have you installed Rails? `gem install rails`, or if you're within a Rails project that uses Bundler, run `bundle` – Stuart M Mar 13 '13 at 07:12
  • i am extremely new to ruby/rails i took a c program i made in class and converted it to ruby, i have never used rails but i know i will need it as i progress. i wanted to install rails with rvm, since eventually i plan to move up to dev in the company and will need to be able to switch between installs to help customers. – Robert Mar 13 '13 at 07:20
  • Sure, no problem. RVM, the **Ruby** Version Manager, just helps you install ruby itself, it isn't designed to install Ruby _gems_ for you, since the gems you need can vary depending on what kind of Ruby app you're running (such as Rails). So you need to install the `rails` gem separately – Stuart M Mar 13 '13 at 07:22
  • If you run `curl -L https://get.rvm.io` and read the Bash source of the RVM install script, it is basically just running `gem install rails` after it installs RVM + Ruby when you pass the `--rails` argument – Stuart M Mar 13 '13 at 07:36
  • when i run `gem install rails` i get `file 'lib' not found` after the rails 3.2.12 install, and at the end. – Robert Mar 13 '13 at 07:45
  • http://stackoverflow.com/questions/2709683/ruby-on-rails-beta-3-install-problem-on-snow-leopard/3975020#3975020 – Stuart M Mar 13 '13 at 07:50