I'm a beginner ror programmer with a macbook air. i've just managed to upgrade my leopard to Lion. Downloaded codex 10.7 and macport and also RVM. The thing i'm trying to do now is to update my ruby from 1.8.7 to 1.9.3 but this is what i got:
I typed out: 'rvm install ruby-1.9.2-p318"
Annie-Tungs-MacBook-Air:~ annietung$ rvm install ruby-1.9.2-p318 Fetching yaml-0.1.4.tar.gz to /Users/annietung/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/annietung/.rvm/src Configuring yaml in /Users/annietung/.rvm/src/yaml-0.1.4. Error running ' ./configure --prefix="/Users/annietung/.rvm/usr" ', please read /Users/annietung/.rvm/log/ruby-1.9.2-p318/yaml/configure.log Compiling yaml in /Users/annietung/.rvm/src/yaml-0.1.4. Error running 'make ', please read /Users/annietung/.rvm/log/ruby-1.9.2-p318/yaml/make.log
Database file /Users/annietung/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/annietung/.rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...
ruby-1.9.2-p318 - #fetching ruby-1.9.2-p318 - #extracted to /Users/annietung/.rvm/src/ruby-1.9.2-p318 (already extracted) ruby-1.9.2-p318 - #configuring Error running ' ./configure --prefix=/Users/annietung/.rvm/rubies/ruby-1.9.2-p318 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/annietung/.rvm/usr ', please read /Users/annietung/.rvm/log/ruby-1.9.2-p318/configure.log There has been an error while running configure. Halting the installation. ls: /Users/annietung/.rvm/rubies/*/bin/ruby: No such file or directory Annie-Tungs-MacBook-Air:~ annietung$
Looks like you need to download and install Apple's Command Line Tools for OSX Lion so that you can build Ruby properly.
Related
I've hit the problem of setup of RVM + Rubies on a new Mac laptop where after getting RVM installed plus Homebrew the install for Rails hits the error:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
Background and Environment
Mac OS X 10.12.3. (Sierra)
Homebrew 1.1.8. with OpenSSL installed
RVM 1.28.0
Ruby 2.3.3 Rails (attempting to install the latest)
Environment variables (following OpenSSL crate fails compilation on Mac OS X 10.11) the following variables have been setup in the Shell environment
LDFLAGS = -L/usr/local/opt/openssl#1.1/lib
CPPFLAGS = -I/usr/local/opt/openssl#1.1/include
PKG_CONFIG_PATH = /usr/local/opt/openssl#1.1/lib/pkgconfig
Discoveries & Fault Diagnosis
Starting with a clean laptop I had followed the usual path of installing Homebrew, Xcode command line tools, MySQL (for rails dev), Git and then RVM. Even with the environment variables set and also uninstalling and rebuild of RVM, removing and re-adding OpenSSL within Homebrew, when trying to get Rails installed I'm greeted with the error:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
The other item to note is that when installing RVM I made sure that RVM was aware of Homebrew:
rvm autolibs enable
ram autolibs homebrew
The output from the install of ruby-2.3.3 is below:
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.12/x86_64/ruby-2.3.3.tar.bz2
Checking requirements for osx_brew.
Updating Homebrew...
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.3.3 - #configure
ruby-2.3.3 - #download
ruby-2.3.3 - #validate archive
ruby-2.3.3 - #extract
ruby-2.3.3 - #validate binary
Libraries missing for ruby-2.3.3: /Users/travis/.rvm/rubies/ruby-2.3.3/lib/libruby.2.3.0.dylib. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, trying to compile.
Checking requirements for osx_brew.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/grantsayer/.rvm/rubies/ruby-2.3.3, this may take a while depending on your cpu(s)...
ruby-2.3.3 - #downloading ruby-2.3.3, this may take a while depending on your connection...
ruby-2.3.3 - #extracting ruby-2.3.3 to /Users/grantsayer/.rvm/src/ruby-2.3.3
Next Steps
Currently I'm stuck - not been able to get past this step or validate through reviewing other postings to get a solution that works.
Well I found a solution to the problem previously described. The following steps outline how it was resolved.
CleanUp
Removed the installation of Homebrew via ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Removed the installation of RVM via rvm implode
Rebuild
Install Homebrew using ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
Do integrity check on Brew using brew upgrade followed by brew doctor
Install RVM (again!) using \curl -sSL https://get.rvm.io | bash -s stable
Ensure that RVM knows about homebrew through the autolibs option using rvm autolibs homebrew
Setup the environment variables so that we know where the openssl is installed:
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
Install ruby via rvm install 2.3.3 --autolibs=homebrew
Check that it Works
Check that the rvm space knows about the OpenSSL certificates using rvm osx-ssl-certs status all. Running this command produced the following output: Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
Install rails via gem install rails
At the last step the installation succeeded and Rails was working (at last!)
If that doesn't work for another reader -
try this:
rvm get branch /bugfix/3923_set_osx_brew_openssl_compiler_config
rvm install 2.4.0
If that works for you, go to the rvm issue and tell the developer how much you appreciate his effort :)
Running:
Mac OS X Lion 10.7.4
xCode Version 4.4.1
Ruby 1.8.x
Brew
Rvm
I'm trying to install ruby on rails on my mac (above are my specs). But it doesn't really come out the way it used to be. I tried several tutorials on the web including Stack Overflow.
As soon as I try:
$ sudo gem install rails
I get this error:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
Same with Ruby 1.9.2
EDIT
Error for installing ruby
Peter-Corverss-MacBook-Pro:~ Beer$ rvm install ruby-1.9.2-p290
Fetching yaml-0.1.4.tar.gz to /Users/Beer/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Beer/.rvm/src
Configuring yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/make.log
Installing Ruby from source to: /Users/Beer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8604k 100 8604k 0 0 225k 0 0:00:38 0:00:38 --:--:-- 202k
ruby-1.9.2-p290 - #extracting ruby-1.9.2-p290 to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #extracted to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #configuring
Error running './configure --prefix=/Users/Beer/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/configure.log
There has been an error while running configure. Halting the installation.
Above code with some color (image):
This is the start for installing ruby and I can't get it to work.
I really tried but I can't fix the problem, hope someone could help me.
Yeah if you're having trouble building ruby, you probably need the command line utilities from Xcode. Checkout: http://developer.apple.com/library/mac/#recipes/xcode_help-documentation_preferences/DownloadingandInstallingXcodeComponents/DownloadingandInstallingXcodeComponents.html
It's in the preferences pane with a downloads tab.
After that installs, reopen terminal and try to install 1.9.2 through rvm again. If it doesnt install still, please comment and I'll see if I can figure it out. If it does install, try installing both rails & bundler:
rvm use ruby-1.9.2 --default
gem install rails
gem install bundler
The first line will switch you into 1.9.2 and should set it up as your default environment.
I just installed Ruby Version Manager 1.10.2 and attempted to install Ruby 1.9.2 and I get the following error:
ayman-al-abdullahs-macbook:~ Terminal$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to /Users/Terminal/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Terminal/.rvm/src
Configuring yaml in /Users/Terminal/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/Terminal/.rvm/usr" ', please read /Users/Terminal/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/Terminal/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/Terminal/.rvm/log/ruby-1.9.2- p290/yaml/make.log
Database file /Users/Terminal/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/Terminal/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #extracting ruby-1.9.2-p290 to /Users/Terminal/.rvm/src/ruby-1.9.2- p290
ruby-1.9.2-p290 - #extracted to /Users/Terminal/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #configuring
Error running ' ./configure --prefix=/Users/Terminal/.rvm/rubies/ruby-1.9.2-p290 -- enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Terminal/.rvm/usr ', please read /Users/Terminal/.rvm/log/ruby-1.9.2-p290/configure.log
There has been an error while running configure. Halting the installation.
I opened the .rvm/log/ruby-1.9.2-p290/configure.log I received the following error:
[2012-02-10 21:14:02] ./configure --prefix=/Users/Terminal/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Terminal/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml
checking build system type... i386-apple-darwin10.8.0
checking host system type... i386-apple-darwin10.8.0
checking target system type... i386-apple-darwin10.8.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/Terminal/.rvm/src/ruby-1.9.2-p290':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
I tried rm the file and reinstalling it, and I still get the same error.
Does anyone have any clue what this could be?
Thank you!
UPDATE UPDATE
Fixed it!
Downloading xcode from Apple requires you to be a developer ($99) or pay $5 for version 10.7 (which requires Lion).
I was able to procure an older version of XCode made specifically for Snow Leapard (4.0.2). After downloading, and installing Ruby version 1.9.3 it ran perfectly.
Thank you all for your help!
Let me know if anyone else runs into this same issue and I'll be happy to walk you through my terminal steps (saved the terminal log).
It seems you don't have gcc. Install Apple Developer Tools.
I fixed it!
Downloading xcode from Apple requires you to be a developer ($99) or pay $5 for version 10.7 (which requires Lion).
I was able to procure an older version of XCode made specifically for Snow Leapard (4.0.2). After downloading, and installing Ruby version 1.9.3 it ran perfectly.
Thank you all for your help!
Let me know if anyone else runs into this same issue and I'll be happy to walk you through my terminal steps (saved the terminal log).
I've an error when I want to install Ruby 1.9.3 on OS X. I've seen most of the problem come from xCode not being installed. So, I installed it and I still have the problem, so, here it is:
MacBook-Pro-de-Arnaud:~ Arnaud$ rvm install 1.9.3
Installing Ruby from source to: /Users/Arnaud/.rvm/rubies/ruby-1.9.3-p0, this may take a >while depending on your cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 - #extracted to /Users/Arnaud/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/Arnaud/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Arnaud/.rvm/src
Configuring yaml in /Users/Arnaud/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/Arnaud/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/Arnaud/.rvm/usr
ruby-1.9.3-p0 - #configuring
ERROR: Error running ' ./configure --prefix=/Users/Arnaud/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/Arnaud/.rvm/usr ', please read /Users/Arnaud/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.
So, I decide to let the 1.8.7 and direct go to Rails and the install seems to go well, but nothing is istall :/
MacBook-Pro-de-Arnaud:~ Arnaud$ sudo gem install rails
Password:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
MacBook-Pro-de-Arnaud:~ Arnaud$ gem list
*** LOCAL GEMS ***
MacBook-Pro-de-Arnaud:~ Arnaud$ rail
-bash: rail: command not found
MacBook-Pro-de-Arnaud:~ Arnaud$ rails
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/rails:18
Would anyone have a solution ?
rvm install 1.9.3 --with-gcc=clang
As suggested here worked for me.
I had a very similar problem with Ruby 1.9.3.
After going through the logs and trolling the internet I found that I had to:
1 - install GCC
2 - link to 64 bit libraries
3 - reinstall rails and sqlite3
I've noted what I did here to remember what I did, and hopefully help someone else who is having similar issues.
I am trying to install ruby1.9.2 using rvm on my Linux system (Mint-Linux distro), but I am unable to due to some errors which I cannot debug. This is the error I am getting when I run the install command.
$ rvm install 1.9.2
Installing Ruby from source to: /home/nnn/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #extracted to /home/nnn/.rvm/src/ruby-1.9.2-p290 (already extracted)
Fetching yaml-0.1.4.tar.gz to /home/nnn/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /home/nnn/.rvm/src
Configuring yaml in /home/nnn/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/nnn/.rvm/src/yaml-0.1.4.
Installing yaml to /home/nnn/.rvm/usr
ruby-1.9.2-p290 - #configuring
ERROR: Error running ' ./configure --prefix=/home/nnn/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/home/nnn/.rvm/usr ',
please read /home/nnn/.rvm/log/ruby-1.9.2-p290/configure.log
ERROR: There has been an error while running configure. Halting the installation.
The configure.log file has the following errors.
./configure --prefix=/home/nnn/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/home/nnn/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml-dir
configure: error: could not determine MAJOR number from version.h
Can you please help me out ?
Thanks
If you run
./configure --help
you will see that there is indeed no option 'with-libyaml-dir', it is not supported by Ruby's main configure script.
These "with-xxx-dir" parameters are often used during the compilation of extensions, where you create a Makefile by running
ruby extconf.rb --with-libimportantforextension-dir=...
In your case a workaround solution would be to install libyaml using apt-get:
sudo apt-get install libyaml
This way RVM will probably recognize that it is already installed and will not attempt to download and install it to a custom location, so you shouldn't receive the error you currently get anymore.