El Capitan Ruby binaries installation issue - ruby-on-rails

Just trying to get through some parts of the Hartl rails tutorial to familiarize myself with the rails framework. I have homebrew installed (removed and reinstalled it because it giving me trouble after using El Capitan), and got a fresh version of rvm with rvm get stable
I went into the directory containing the project, and I got this message
ruby-2.3.0-dev is not installed.
To install do: 'rvm install ruby-2.3.0-dev'
Previously, I'd tried using 2.3.0 as the latest version (it was the newest thing showing up when I ran rvm list, not sure why), but now I want to change that to 2.3.1. Anybody know how I can change the ruby version for this project?
Additionally, when I run rvm install ruby-2.3.1 , I get this error
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.1.
This led me to trying to reinstall homebrew, update my version of rvm, etc. I tried all of that and am still getting this error message.
The whole reason this happened is because I tried executing a test with
$ bundle exec rake test
I got this message
RubyDep: WARNING: Your Ruby is outdated/buggy. (To disable warnings, set RUBY_DEP_GEM_SILENCE_WARNINGS=1)
RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: install 2.3.1.
Haven't been able to install 2.3.1 and I'm just losing my mind here.
edit - Does one recommend installing directly from source instead of using binaries?

I've reproduced your steps in my Mac laptop running OS X El Capitan. Executing the command rvm install 2.3.1 I got the same error as you, but after that rvm kept on executing the command and eventually downloaded and installed the binaries of Ruby 2.3.1. My output was like this:
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-2.3.1, this may take a while depending on your cpu(s)...
ruby-2.3.1 - #downloading ruby-2.3.1, 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 13.7M 100 13.7M 0 0 5854k 0 0:00:02 0:00:02 --:--:-- 5855k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.1 - #extracting ruby-2.3.1 to /Users/user/.rvm/src/ruby-2.3.1....
ruby-2.3.1 - #configuring...........................................................
ruby-2.3.1 - #post-configuration.
ruby-2.3.1 - #compiling.............................................................
ruby-2.3.1 - #installing.........
ruby-2.3.1 - #making binaries executable..
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.3.1 - #gemset created /Users/user/.rvm/gems/ruby-2.3.1#global
ruby-2.3.1 - #importing gemset /Users/user/.rvm/gemsets/global.gems...............................................
ruby-2.3.1 - #generating global wrappers........
ruby-2.3.1 - #gemset created /Users/user/.rvm/gems/ruby-2.3.1
ruby-2.3.1 - #importing gemsetfile /Users/user/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.1 - #generating default wrappers........
ruby-2.3.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.1 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
After that I executed rvm use 2.3.1 and ruby -v and the output of the last command was:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
So I could successfully install Ruby 2.3.1 on Mac OS X El Capitan. Please provide further information if this cannot help solving your problem.

Related

RVM issue with macOS Sierra while installing Ruby 2.2.6

I'm running OSX (10.12.3) and I have Ruby installed (2.2.2) which is working fine. I'm trying to upgrade to 2.2.6 using RVM. Install seems to go fine.
- rvm install 2.2.6
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.2.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /location/.rvm/rubies/ruby-2.2.6, this may take a while depending on your cpu(s)...
ruby-2.2.6 - #downloading ruby-2.2.6, this may take a while depending on your connection...
ruby-2.2.6 - #extracting ruby-2.2.6 to /location/.rvm/src/ruby-2.2.6....
ruby-2.2.6 - #configuring..........................................................
ruby-2.2.6 - #post-configuration.
ruby-2.2.6 - #compiling...........................................................
ruby-2.2.6 - #installing..........
ruby-2.2.6 - #making binaries executable..
ruby-2.2.6 - #downloading rubygems-2.6.10
ruby-2.2.6 - #extracting rubygems-2.6.10.....
ruby-2.2.6 - #removing old rubygems.........
$LANG was empty, setting up LANG=en_US, if it fails again try setting LANG to something sane and try again.
ruby-2.2.6 - #installing rubygems-2.6.10.....................
ruby-2.2.6 - #gemset created /location/.rvm/gems/ruby-2.2.6#global
ruby-2.2.6 - #importing gemset /location/.rvm/gemsets/global.gems................................................
ruby-2.2.6 - #generating global wrappers........
ruby-2.2.6 - #gemset created /location/.rvm/gems/ruby-2.2.6
ruby-2.2.6 - #importing gemsetfile /location/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.6 - #generating default wrappers........
ruby-2.2.6 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.2.6 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
But when I try following commands, I'll get some errors.
- bundle
-bash: bundle: command not found
- gem install bundler
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
So while installation seems to go fine, it can't require openssl when trying to install any gem. What might be the issue here and how could I fix it?
I tried purging whole RVM and a clean reinstall, which didn't help. Using the answer by phq from here I managed to get it working.
rvm remove 2.2.6
rvm pkg install openssl
rvm install 2.2.6 --with-openssl-dir=$HOME/.rvm/usr
gem install bundler
bundle
It's probably not the best solution as it manually loads openssl, but it seems to currently be the only solution that works for me.
If you still don't have Homebrew installed, you should go ahead and give it a try. As they say, "Homebrew installs the stuff you need that Apple didn’t," which in your case is openssl.
Install Homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install openssl: brew install openssl
Try installing bundler again: gem install bundler
To avoid problems in the future, I suggest you take a look at RVM Autolibs. It automatically installs any dependency you need using Homebrew or other manager. If you don't wanna read the documentation, just run: rvm autolibs enable && rvm autolibs packages && rvm autolibs homebrew and you'll be fine.

Setup RVM, Ruby on Mac OS X Sierra: Unable to require openssl

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 :)

Installed Ruby 2.4 but when I'm still showing Ruby 2.3

I'm trying to intsall Ruby 2.4 on my Mac Sierra machine. I thought i had done it successfully ...
localhost:myproject nataliab$ rvm use 2.4.0
Warning! PATH is not properly set up, '/Users/nataliab/.rvm/gems/ruby-2.3.0/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.3.0'.
ruby-2.4.0 is not installed.
To install do: 'rvm install ruby-2.4.0'
localhost:myproject nataliab$ rvm install ruby-2.4.0
Warning! PATH is not properly set up, '/Users/nataliab/.rvm/gems/ruby-2.3.0/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.3.0'.
Warning, new version of rvm available '1.28.0', you are using older version '1.26.11'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.4.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates in '/usr/local/etc/openssl/cert.pem'.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/nataliab/.rvm/rubies/ruby-2.4.0, this may take a while depending on your cpu(s)...
ruby-2.4.0 - #downloading ruby-2.4.0, 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 11.9M 100 11.9M 0 0 2715k 0 0:00:04 0:00:04 --:--:-- 2880k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.4.0 - #extracting ruby-2.4.0 to /Users/nataliab/.rvm/src/ruby-2.4.0....
ruby-2.4.0 - #configuring..................................................................
ruby-2.4.0 - #post-configuration.
ruby-2.4.0 - #compiling.............................................................
ruby-2.4.0 - #installing.......
ruby-2.4.0 - #making binaries executable..
Installed rubygems 2.6.8 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.4.0 - #gemset created /Users/nataliab/.rvm/gems/ruby-2.4.0#global
ruby-2.4.0 - #importing gemset /Users/nataliab/.rvm/gemsets/global.gems...............................................
ruby-2.4.0 - #generating global wrappers........
ruby-2.4.0 - #gemset created /Users/nataliab/.rvm/gems/ruby-2.4.0
ruby-2.4.0 - #importing gemsetfile /Users/nataliab/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.0 - #generating default wrappers........
ruby-2.4.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.4.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
And then I see the right Ruby version ...
localhost:myproject nataliab$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
But when I open up a new terminal window, navigate to my project directory, I no longer see the newly installed version ...
localhost:myproject nataliab$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]
How do I make my version stick?
Change your default ruby:
$ rvm default ruby-2.4.0
$ rvm list
#rvm rubies
# ruby-2.3.0 [ x86_64 ]
#=* ruby-2.4.0 [ x86_64 ]
# ruby-head [ x86_64 ]
## => - current
## =* - current && default
## * - default
In project dir
do not add any 'ruby "2.4.0"' line in Gemfile
if there is .rvmrc file delete it
create files (at least some rvm versions require both version and gemset files to exist)
.ruby-version
2.4.0
.ruby-gemset
app
Trigger rvm to reload them
cd .
ruby --version
rvm gemset list
install bundler for 2.4.0 (if it is missing)
rvm 2.4.0#global do gem install bundler

ERROR: Error running 'GEM_PATH=" qhen running "sudo rvm install 1.9.3-p194" [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Installed Ruby 1.9.3 with RVM but command line doesn’t show ruby -v
I try to run this comand
-> sudo rvm install 1.9.3-p194
but this errors appears and the instalation was unsuccessful
Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #fetching
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, 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 9610k 100 9610k 0 0 181k 0 0:00:53 0:00:53 --:--:-- 235k
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /usr/share/ruby-rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #extracted to /usr/share/ruby-rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #configuring
ruby-1.9.3-p194 - #compiling
ruby-1.9.3-p194 - #installing
Removing old Rubygems files...
-e:1: Use RbConfig instead of obsolete and deprecated Config.
Installing rubygems dedicated to ruby-1.9.3-p194...
Retrieving rubygems-latest-1.8
Extracting rubygems-latest-1.8 ...
ERROR: Error running 'gunzip < /usr/share/ruby-rvm/archives/rubygems-latest-1.8.tgz | tar xf - -C /usr/share/ruby-rvm/src', please read /usr/share/ruby-rvm/log/ruby-1.9.3-p194/rubygems.extract.log
Installing rubygems for /usr/share/ruby-rvm/rubies/ruby-1.9.3-p194/bin/ruby
ERROR: Error running 'GEM_PATH="/usr/share/ruby-rvm/gems/ruby-1.9.3-p194:/usr/share/ruby-rvm/gems/ruby-1.9.3-p194#global:/usr/share/ruby-rvm/gems/ruby-1.9.3-p194:/usr/share/ruby-rvm/gems/ruby-1.9.3-p194#global" GEM_HOME="/usr/share/ruby-rvm/gems/ruby-1.9.3-p194" "/usr/share/ruby-rvm/rubies/ruby-1.9.3-p194/bin/ruby" "/usr/share/ruby-rvm/src/rubygems-latest-1.8/setup.rb"', please read /usr/share/ruby-rvm/log/ruby-1.9.3-p194/rubygems.install.log`
WARN: Installation of rubygems did not complete successfully.
ruby-1.9.3-p194 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p194 - #importing default gemsets (/usr/share/ruby-rvm/gemsets/)
Install of ruby-1.9.3-p194 - #complete
first of all why do you use sudo command before rvm? this link will help you in that rvm.io/rubies/rubygems . I don't thing that you have to use sudo.
Also you can look into this question error while installing ruby 1.9.3 using rvm
Also 'rvm install ruby' will install you latest stable version of ruby.
You are using an very old version of RVM that is packaged with Ubuntu, make sure to follow instructions from this answer https://stackoverflow.com/a/9056395/497756 - gunzip is no more used in RVM so this problem should be fixed.

Ruby on rails installation fails on my mac

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.

Resources