Failed to install ruby ​​via macports. How long will this action last?

I am trying to install ruby ​​using macports. I entered the following command into the terminal:

sudo port install ruby 

The terminal responded by returning some lines that indicated that the action was working, and then simply stopped returning any new lines. I typed:

 which ruby 

and did not receive a response, so I closed the terminal window and, therefore, ended the processes.

I opened a new terminal window and re-typed the original installation command, and now I get the following message:

 Waiting for lock on /opt/local/var/macports/registry/.registry.lock 

How do I proceed? Should I just wait? If so, for how long? Will the terminal try to perform this action twice? How can I find out if it works?

+7
source share
5 answers

A more suitable thing to check when you have not noticed any progress is your system activity.

On Mac OS, you can either open the "Activity Monitor", or sort by CPU, or open a terminal and enter top -o cpu . Make sure that some application shows constant activity, especially something with a "port" in the name.

To handle the lock ... the odds are REALLY good, it's outdated since you cut it to your knees, closing the terminal, so use sudo rm /opt/local/var/macports/registry/.registry.lock to remove it and try again , if you want to.

I will recommend RVM for installing new versions of Ruby. It is very comfortable. Before you switch to RVM, read the Installation and Rubigames pages completely, and after installing the RVM type, rvm notes and follow the instructions that it spits out.

Finally, under no circumstances, under any circumstances, no matter how good the idea seems to be, try to replace or upgrade the version of Ruby installed by Apple. Apple installed it for its own use, and bad juju invites you to mess with it.

+7
source

" Waiting for lock on /opt/local/var/macports/registry/.registry.lock " means that MacPorts is already working and is doing something. You can check all running "port" processes in Activity Monitor. Wait until these tasks are complete (or stop them if you care that they don't end) before trying to do other things with MacPorts.

ps -A | grep tclsh ps -A | grep tclsh if you cannot find the current process so that it can be killed.

+1
source

A later way to install Ruby is through RVM . Not a direct answer to your question, but I would highly recommend it.

0
source

Here is another vote for rvm. If you are like me and you are programming on Mac, but you are deploying it in a different * nix, you can make sure that you have the same version of Ruby (and Rails and gems) for each, using rvm gemsets.

In addition, you can easily switch between gemset, so if you find a gem that you cannot work with with Ruby 1.9.2 normally, you can switch to 1.8.7 or some of them while you try to understand it out. Such things.

As far as I can tell, you can go directly to your mac (like you, rather than using sudo) with rvm install 1.8.7 or rvm install 1.9.2. Then, make sure you switch to using the correct rvm and create the one you want by default, and you are golden. If this does not work, delete it - all gemsets will be installed below your home directory in .rvm / *

The pain you are currently experiencing will reappear when you try to keep your version of the Mac ruby ​​operating system in all the material you wrote - RVM is definitely easier than using Mac Ruby.

0
source

In addition to what Tin Man mentioned, if other blocking errors start to appear, I found that disconnecting the Internet connection for a moment was useful to stop all the port processes that were occurring.

0
source

All Articles