Unable to install ruby using rvm due to mac port issues - ruby

I am trying to install ruby 1.9.2 or latest to work with cupertino gems
In order to install ruby, i have install 3rd party tool(RVM)
I am able to install rvm, However to install ruby, i am getting macport errors
I tried to resolve it using existing stackoverflow question, but it does not aid me clearly in resolving the issue
Steps which i followed are:
Installed rvm from get.rvm.io
activated rvm using below command:
$ source ~/.rvm/scripts/rvm
Now i am trying to install ruby 1.9.2 using following command:
$ rvm install 1.9.2
it fails with following error
*BLR4AUTOMATION2:ruby-1.9.2-p320 admin$ rvm install 2.0.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p247.
Continuing with compilation.
Please read 'rvm help mount' to get more information on binary rubies. Installing requirements for osx, might require sudo password.
Password:
DEBUG: Copying /Users/admin/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync rsync: failed to connect to rsync.macports.org:
Connection refused (61) rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing "macports::selfupdate [array get global_options]
base_updated"
Error: /opt/local/bin/port: port selfupdate failed:
Error synchronizing MacPorts sources: command execution failed
Requirements installation failed with status: 1.*
I have tried to follow several thread related to it, but it did not work for me:
http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy
synching macports using tarballs and other sources
Tried to uninstall macports from my mac and reinstall, but that also make no use
Reinstall latest xcode with cli
I have uploaded the console logs at below location:
https://docs.google.com/document/d/1l_OFbE5d0tliKdnU_gF6Bil75Ek7wJb58h7Da_JTXdQ/edit?usp=sharing
At the same time i am able to install the ruby in my other mac machines but not on build machine
Can any one please help me in setting up ruby(1.9.2 or higher) using rvm or with other ways.
Thanks in advance!!
kishan

Check if the internet ports are available in your router, I tried in college (tons of ports closed) and got the same problem, try again in my house with less locked ports and worked just fine.

make sure you can run
sudo /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
when you find proper flags (proxy!) then you can make sure macports will use them with rsync_options from macports.conf

Related

Problems installing ruby with rvm install 2.6.1

Whenever I try to install Ruby 2.6.1 on Ubuntu this error keeps coming up. Does anyone have any solutions?
$ rvm install 2.6.1
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
mkdir: cannot create directory ‘/usr/share/rvm/log/1624238816_ruby-2.6.1’: Permission denied
tee: /usr/share/rvm/log/1624238816_ruby-2.6.1/update_system.log: No such file or directory
Updating systemddsmith password required for 'apt-get --quiet --yes update': ..-
..
Error running 'requirements_debian_update_system ruby-2.6.1',
please read /usr/share/rvm/log/1624238816_ruby-2.6.1/update_system.log
Requirements installation failed with status: 1.`

File system permission error when installing Ruby using RVM on Ubuntu

I am currently unable to run rvm install through Ubuntu and I have an idea as to why, but have no idea how to fix it.
Here's what's happening
~$ rvm install 2.6.1
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
mkdir: cannot create directory ‘/usr/share/rvm/log/1609714241_ruby-2.6.1’: Permission denied
tee: /usr/share/rvm/log/1609714241_ruby-2.6.1/update_system.log: No such file or directory
Updating system....
Error running 'requirements_debian_update_system ruby-2.6.1',
please read /usr/share/rvm/log/1609714241_ruby-2.6.1/update_system.log
Requirements installation failed with status: 1.
Any help would be very much appreciated.
I ended up changing my ability to edit the directory
/log/
and I am now being shown There was an error(23). Failed download There has been an error fetching the ruby interpreter. Halting the installation.
when I attempt to install
I found that I needed to add my Ubuntu user to rvm group using rvm group add rvm "$USER"
Issue resolved

RVM - MacPorts won't update through proxy

I'm trying to use RVM to install ruby on my iMac.
I start by typing the following:
rvm list known
I then target the version that I want to install (the guide I'm following recommends 1.9.2 instead of the base 1.8.7) with the following line:
rvm install 1.9.2
Then I get this:
27698AM:~ butler15$ rvm install 1.9.2
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.9.2-p320.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Password:
I enter my password and I get this:
DEBUG: Copying /Users/butler15/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Operation timed out (60)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed
If I understand correctly it's trying to update MacPorts but fails due to being behind a proxy (or something?)
I've tried following this guide but it didn't work: http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/
Further Information:
My current version of RVM and RUBY: http://d.pr/i/H1Eu
My OSX - 10.7.4
Thanks in advance for your help :)
While Koji's comment makes RVM work behind a proxy, Macports will need to be updated to automatically work behind a proxy as well.
First, install macports from the package at http://www.macports.org/install.php
Then run the following commands:
sudo mkdir -p /opt/local/var/macports/sources/svn.macports.org/trunk/dports/
cd /opt/local/var/macports/sources/svn.macports.org/trunk/dports/
sudo svn co http://svn.macports.org/repository/macports/trunk/dports/ .
In /opt/local/etc/macports/sources.conf comment out
rsync://rsync.macports.org/release/tarballs/ports.tar [default]
with your favorite editor and then add this right below that line.
file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ [default]
And then run these commands so that it updates and doesn't complain about your ports not being indexed.
sudo port -d sync
sudo portindex
Then modify .rvm/scripts/functions/requirements/osx_port by changing selfupdate to sync in the requirements_osx_port_update_system() function.
requirements_osx_port_update_system()
{
#__rvm_try_sudo port -dv selfupdate || return $?
__rvm_try_sudo port -dv sync || return $?
}
If you are trying MAKE MACPORTS WORK BEHIND PROXY, How about avoiding port selfupdate?
$ diff -u .rvm/scripts/functions/requirements/osx_port.org .rvm/scripts/functions/requirements/osx_port
--- .rvm/scripts/functions/requirements/osx_port.org 2013-05-28 16:58:37.000000000 +0900
+++ .rvm/scripts/functions/requirements/osx_port 2013-05-28 16:58:50.000000000 +0900
## -82,7 +82,7 ##
requirements_osx_port_update_system()
{
- __rvm_try_sudo port -dv selfupdate || return $?
+ __rvm_try_sudo port -dv sync || return $?
}
requirements_osx_port_define()
In my case, it works fine.
run "__rvm_try_sudo port -dv selfupdate" in terminal and type in password by keyboard
then re-run the script to install ruby
It works on my laptop
Good luck
You need to (re)install the command lines tools first:
sudo xcode-select --install
then, update macports:
sudo port -v selfupdate
Source: https://stackoverflow.com/a/19634495/226255
Then, you might be missing some requirements so do:
sudo rvm requirements

Could not install Ruby 2.0 because Openssl.org down?

I tried to install ruby-2.0.0-p0 on Macintosh at several times. But I never success. I tried brew install openssl or rvm pkg install openssl but progress bar is always 0% and I never access to www.openssl.org. There are no way to install them without openssl. Is this only my probrem? I found any similar resources but there are not help for me... Am I banned from Openssl? Or it is not only my problem? Could you someone tell me any good advice?
EDIT
Thanks #fmendez, But I hit same error again... Full trace on Gist
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
Error: Download failed: http://openssl.org/source/openssl-1.0.1e.tar.gz
$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
0.0%
curl: (7) couldn't connect to host
Error: Download failed: http://openssl.org/source/openssl-1.0.1e.tar.gz
EDIT
Finally I've connected openssl.org. I didn't know what was the problem :\
Sorry for any attentions. I will delete this.
The url pointed to by the latest openssl brew formula is: http://openssl.org/source/openssl-1.0.1e.tar.gz and it is working fine. Try doing a brew update, then the following:
rvm get head
rvm pkg remove
rvm requirements run
rvm reinstall 2.0.0
Note
After running the rvm requirements make sure you install any library hinted by homebrew if any.

Unable to get ruby running on Mac OSX 10.8.3

I have been trying to get Ruby to run on my Mac for a few days and whatever I do does not seem to be successful. I have installed MacPorts and followed the post here: Installing Ruby on Mac OS X 10.8.2
I ran the following commands:
sudo port selfupdate
sudo port install apple-gcc42
They completed sucessfully then I ran the line below:
CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl
After I run that line it takes a couple minutes and I get the following:
enter code here MacPorts base is already the latest version
DEBUG: Setting MacPorts sources ownership to root
The ports tree has been updated. To upgrade your installed ports, you should run
port upgrade outdated
i686-apple-darwin12-gcc-apple-4.2.1: no input files
Missing required packages: autoconf, automake, libtool, pkgconfig, libiconv, libyaml, readline, libxml2, libxslt, libksba, openssl, curl-ca-bundle, sqlite3, zlib, ncurses, gdbm.
Cowardly refusing to continue, please read 'rvm autolibs'.
There were package installation errors, make sure to read the log.
Do I need to install the missing packages that it references? If so, how do I do this? I'm not very familiar with MacPorts and would appreciate the help to get this working.
Since I originally I went to install RVM through https://rvm.io/rvm/install/ I followed the first command to RVM with ruby:
$ \curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
After I ran the command it downloaded and compiled then when it went to install rubygems-2.0.3 for ruby-2.0.0-p0 it gave the following error message:
Error running 'env GEM_PATH=/usr/local/rvm/gems/ruby-2.0.0-p0:/usr/local/rvm/gems/ruby-2.0.0-p0#global:/usr/local/rvm/gems/ruby-2.0.0-p0:/usr/local/rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/usr/local/rvm/gems/ruby-2.0.0-p0 /usr/local/rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /usr/local/rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /usr/local/rvm/log/ruby-2.0.0-p0/rubygems.install.log
I then went to open the log file and at the bottom it says
ERROR: While executing gem ... (NoMethodError) undefined method fu_stream_blksize for #<Gem::Commands::SetupCommand:0x007fa09b05d7a8>
Installing RubyGems
Installing gem executable
Any ideas what I can do next?
Thanks in advance.
I had similar problems with OS X 10.8.3 and XCode 4.6.1. After some googling, I tried the install with a similar RVM command, except using the XCode version of clang (which symlinks to /usr/bin/cc). Try this:
\curl -#L https://get.rvm.io | bash -s stable #just get rvm
source ~/.rvm/scripts/rvm
rvm get head # update to latest rvm
CC=/usr/bin/cc rvm install ruby
It should have the same failure installing rubygems-2.0.3, but reinstalling just rubygems should work:
CC=/usr/bin/cc rvm install rubygems latest # substitute "2.0.3" for "latest" if you like.
It appears that this is a bug in rubygems which is scheduled for fixing in 2.0.4.
Hope that helps!
I think this bug provide from FileUtils.
To fix it you need change rubygems script from rvm: nano .rvm/scripts/rubygems
To find words in nano use ctrl+w setup.rb and remove --verbose option.
After this you need ctrl+o to save file and ctrl+x to close nano.
Now you may reinstall rubygems:
rvm rubygems remove
rvm rubygems latest
Sorry for my bad english.
Hope this help you.
In addition to Valery's answer, you might have to do the following before removing and reinstalling:
echo ${LANG:-empty}
export LANG=en_US.utf-8
Links to the problem and solution:
https://github.com/rubygems/rubygems/issues/516
https://github.com/wayneeseguin/rvm/issues/1689
This problem is harmless, rubygems is already installed and will work as expected, this is triggered by https://bugs.ruby-lang.org/issues/7992 - with --verbose flag to rubygems installation - your ruby is fully usable if there was no other error during installation.
A side note, RVM detects all the options/flags you have passed and it is not required to pass them manually, it would be enough to run:
rvm install ruby-1.9.3-p194
The RVM installer ran with --autolibs=3 is equivalent to running it withoug and setting it manually with:
rvm autolibs 3
To get more information on autolibs and available modes run:
rvm help autolibs

Resources