RVM - MacPorts won't update through proxy - ruby

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

Related

Error when installing graphviz on Mac using Homebrew

I am using macOS 11.5.1 Big Sur and I tried to install Graphviz via
brew install graphviz
but I got an error:
Error: python#3.9: wrong number of arguments (given 1, expected 0)
The version of my Homebrew is
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 7ff3c752de; last commit 2021-08-13)
Homebrew/homebrew-cask (git revision af069ca1b1; last commit 2021-08-13)
I have no idea about the reason. Any suggestions? Thank you.
I have fixed this issue, by the following commands.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app
Then rerun the brew install:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
It works on my Mac. Just share in case that anyone encounters the same issue.
I was unable to get it to work with homebrew. I read other threads recommending trying with Ports, which I did and failed also, since I got a little farther with Ports, I continue to look and finally found this...
Uninstall graphiz if you tried homebrew: brew uninstall graphviz
Install Ports https://www.macports.org/install.php
edit the Ports installation https://www.macports.org/install.php
Edit opt/etc/macports/sources.conf, comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
Run sync in debug mode and watch for the tarball being used instead of rsync:
sudo port -d sync
sudo port install graphviz

Ruby RVM apt-get update error

I get following error when trying to install anything with RVM:
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/ubuntu/13.04/x86_64/ruby-2.1.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..kshitiz password required for 'apt-get --quiet --yes update':
............................
Error running 'requirements_debian_update_system ruby-2.1.1',
showing last 15 lines of /home/kshitiz/.rvm/log/1400047196_ruby-2.1.1/update_system.log
++ /scripts/functions/logging : rvm_pretty_print() 78 > case "${TERM:-dumb}" in
++ /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print() 83 > [[ -t 2 ]]
++ /scripts/functions/logging : rvm_pretty_print() 83 > return 1
++ /scripts/functions/logging : rvm_error() 117 > printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
++ /scripts/functions/requirements/ubuntu : requirements_debian_update_system() 53 > return 100
Requirements installation failed with status: 100.
How can I fix this?
RVM doesn't behave well if apt-get update has errors. If your apt sources have an invalid repository that gives 404 or GPG error, RVM will refuse to work. This can be confusing because it happens even if the faulty repository has nothing to do with ruby or RVM.
The following fix worked for me (Ubuntu):
Run apt-get update and see if there are any errors. Edit your sources.list and precise.list in /etc/apt to remove the faulty repositories. Repeat until apt-get update succeeds without any errors. Then try running RVM.
You can try to skip the rvm updating system so apt-get won't be called.
# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable
# Then try installing Ruby:
rvm install 2.4.0
See https://stackoverflow.com/a/16759839/1212791
I also had to remove failing repositories but I had hard time spotting them and removing them based on instructions here. So I found this link which explains exactly why this happens and how to remove failing repositories:
In short, run following to find failing repositories:
sudo apt-get update | grep "Failed"
An example output can be like this:
:~# apt-get update | grep "Failed"
W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
And finally use this command to remove the failing repo(s):
sudo add-apt-repository --remove ppa:{failing ppa}
for the example here it will look like this:
sudo add-apt-repository --remove ppa:upubuntu-com/web
Alternative, it is also possible to cut the crap in rvm. I edited requirements_debian_update_system() in file /usr/share/rvm/scripts/functions/requirements/ubuntu like this:
requirements_debian_update_system()
{
echo "*fake* apt-get update"
# __rvm_try_sudo apt-get --quiet --yes update ||
# {
# typeset __ret=$?
# case ${__ret} in
# (100)
# rvm_error "There has been error while updating 'apt-get', please give it some time and try again later.
#404 errors should be fixed for rvm to proceed. Check your sources configured in:
# /etc/apt/sources.list
# /etc/apt/sources.list.d/*.list
#"
# ;;
# esac
# return ${__ret}
# }
}
This happened to me as well when I was trying to install a version of Ruby as a non-sudoer user. However, when I logged in as my admin user (with sudo privileges) and ran sudo apt-get update | grep "Failed" I would get no errors and, yet, rvm install x.x.x would still result in asking for a password (when I ran rvm install as the non-sudoer user.)
I was banging my head with this for a while because I didn't want my rvm (regular user) user to have sudo privileges. Then after some putzing around on Google I figured out that I could log in as my admin user.
Go through the steps of installing RVM for that user (as per their documentation):
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable
$ source ~/.rvm/scripts/rvm
Then (as the admin user) jump straight into installing the RVM required packages:
$ rvm requirements
at which point it asks for my sudo password and installs the required apt packages for the entire system after I enter my password.
Then I log off from server as admin user and log back in as rvm user (with no sudo privileges) and try to install a version of Ruby.
$ rvm install x.x.x
and now it works.
You don't need of apt-get to install rvm and to use it !
Just curl (apt-get install curl)
Launch \curl -sSL https://get.rvm.io | bash -s stable --ruby
and rvm install 2.1.1 or another ruby's version and it works ;)
gem update etc...
RVM will be independent of apt-get so you'll have no longer issu.
For more informations : https://rvm.io/rvm/install
I had the same issue. If none of the other answers work try this. I ran the following command to fix it:
sudo apt-get -f install
Then I remembered that I failed installing a package earlier that day. What this command did was resolve the dependencies on that package and allowed RVM to do its thing.
I just tried
sudo apt-get update and found some of them are failing; for example..
Err http://extras.ubuntu.com raring/main Sources
404 Not Found
I went ahead and deleted those items from the list here..
sudo gedit /etc/apt/sources.list
It worked!
I was getting an error similar to this while running curl -sSL https://get.rvm.io | bash -s stable --ruby. It took a while but I finally realised that I had synaptic open: the installer couldn't run because apt was locked
I was also getting this error when my working directory was inside a mounted dir.
The fix was just to:
cd ~
I figured this out by seeing this at the bottom of a sudo apt-get update
E: Unable to change to /path/to/my/current/directory/ - chdir (13: Permission denied)
I got the same error.I tried most of above answers but none works for me, so i just change server
Goto directory etc/apt
click on Sources.list
Change the server to us or some else server
Reload (it will update your cache from that server)
Then run sudo apt-get update
this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.
In my case rvm missed some linux packages, which couldnt be installed without sudo. There were no apt-get install errors at all.
When running rvm install ruby x.x.x with sudo, rvm installed packages required to build ruby and it worked.
Issue - requirements_debian_update_system ruby-2.2.2 error
I also had the same issue. I found info on this link
Click Here
I followed this and resolved my issue. Was able to install ruby as
rvm install 2.2
1) Before installing ruby must be done update:
apt is preferred over apt-get for interactive use in recent Ubuntu versions and apt should fix by:
sudo apt update
sudo apt upgrade
Or with apt-get may be used --allow-releaseinfo-change
sudo apt-get --allow-releaseinfo-change update
2) After successfully installation, for example ruby-2.3.1:
rvm install 2.3.1
apt install libc6:amd64 libc6:amd64 libc6 libc6-dev:amd64 libc6-dev libc-dev-bin libc-bin man-db libc-dev-bin libc6-dev:amd64
thats work fine for me ^^
The problem is with your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
So to check the errors you have to run this command and need to find that which PPA is firing errors:
sudo apt-get update | grep "Failed"
Then to resolve this error you have to press the Windows key and need to search "Software & Updates".
Then open it and go into Other Software there you can see some URLs which is failed while update.
Then uncheck those URLs from this and close this window and then do
sudo apt-get update
Finally, you can install ruby with
rvm install 2.4
PS: You can change the version you want to install ruby.

installing ruby 1.9.3 of osx mavricsmavrics

I am trying to install ruby 1.9.3 on my osx 10.9 operating system and I keep getting the following error :
Error running 'requirements_osx_port_update_system ruby-1.9.3-p448',
please read /Users/ramesh/.rvm/log/1383430694_ruby-1.9.3-p448/update_system.log
Requirements installation failed with status: 1.
I am using the following command to do the installtion :
rvm install 1.9.3
The complete log is as given below :
checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions
Command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make && make install SELFUPDATING=1
Exit code: 1
DEBUG: Error installing new MacPorts base: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
Requirements update log :
checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions
Command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make && make install SELFUPDATING=1
Exit code: 1
DEBUG: Error installing new MacPorts base: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
Finally I found the solution. I had to install the new command line tools for osx 10.9 (Mavrics) using the following command.
sudo xcode-select --install
Then I had to run the following command to do the macports selfupdate.
sudo port -v selfupdate
Then I can successfull install ruby 1.9.3 using the following command.
rvm install 1.9.3
Hope this will be helpful to anyone facing the same dilema.
On my computer (running mavericks), it seemed like xcode's command line tools were installed because I had access to gcc, git, etc. But there was a small additional package I had to download by doing:
$ sudo xcode-select --install
This prompts to install the command line tools. Followed by $ rvm requirements the rvm prerequisites installed properly and I was able to install ruby.

Unable to install ruby using rvm due to mac port issues

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

Unable to install Meld by MacPorts

I found that other people too have had trouble in installing Meld to Mac by MacPorts.
I run
sudo port install meld
I get
sudo port install meld
---> Activating shared-mime-info #0.60_0
Error: Target org.macports.activate returned: Image error: /opt/local/bin/update-mime-database already exists and does not belong to a registered port. Unable to activate port shared-mime-info.
Error: The following dependencies failed to build: py25-gnome gconf gtk2 shared-mime-info orbit2 libidl gnome-vfs desktop-file-utils gnome-mime-data libbonobo libbonoboui libglade2 libgnome esound audiofile libgnomecanvas libart_lgpl libgnomeui gnome-icon-theme hicolor-icon-theme icon-naming-utils p5-xml-simple p5-xml-namespacesupport p5-xml-sax gnome-keyring libtasn1 py25-gtk py25-cairo py25-numpy py25-nose py25-gobject py25-orbit
Error: Status 1 encountered during processing.
How can you install Meld to Mac?
As rspeed said, you probably had a bad install or upgrade that created that file. Alternately, you installed something outside of macports into the /opt/local tree (though I'm not sure how you would have ended up doing that). I recommend just doing a force activate of the shared-mime-info port, then trying to reinstall meld.
sudo port activate -f shared-mime-info
sudo port install meld
I found that MacPorts worked to install meld, but it didn't work straight away as advertised.
After running and installing all the dependencies, it failed, and gave a cryptic log message similar to the one in this question (but not identical).
After a bit of digging around I found I had to do the following:
Make sure I had properly agreed to the license for XCode
xcodebuild -license
Install the Xcode command line tools
xcode-select --install
Install rarian (it seems to be a dependency that MacPorts failed to recognize)
sudo port install rarian
The latter instructions come from here:
http://www.codez.co.uk/2014/02/meld-on-mac-osx-mavericks-10-9/
and this was the last step before I was able to get it working.
Somehow that file already exists, probably from a bad uninstall or upgrade.
If you force the install it probably won't break anything.
sudo port install --force meld
Installing meld on OS X 10.10. For added difficulty, must use OS X's quartz display server (rather than X11 display server):
$ sudo port install python27
$ sudo port select --set python python27
$ sudo port install rarian
$ sudo port install pango +no_x11
$ sudo port install gtk2 +quartz
$ sudo port install py27-pygtk +quartz
$ sudo port uninstall --follow-dependents gtk3
$ sudo port install gtk3
$ sudo port uninstall py27-pygtksourceview
$ sudo port install py27-pygtksourceview +quartz
$ sudo port install gnome-desktop
$ sudo port install meld +quartz
$ sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
$ sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
<reboot system...>
$ meld
Wow, it works!

Resources