Whenever I try to install a gem with gem install [gem-name], I keep getting this error:
ERROR: While executing gem ... (Errno::ENOLCK)
No locks available # rb_file_flock - /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
I did gem install bundler just for illustration, but the Errno::ENOLCK will occur regardless of the gem I'm trying to install. I've searched around and can't seem to find anything about this error.
Here is the out put from gem env, in case that helps.
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/abod/.rvm/gems/ruby-2.2.0#global
- RUBY EXECUTABLE: /home/abod/.rvm/rubies/ruby-2.2.0/bin/ruby
- EXECUTABLE DIRECTORY: /home/abod/.rvm/gems/ruby-2.2.0#global/bin
- SPEC CACHE DIRECTORY: /home/abod/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/abod/.rvm/rubies/ruby-2.2.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/abod/.rvm/gems/ruby-2.2.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/abod/.rvm/gems/ruby-2.2.0#global/bin
- /home/abod/.rvm/rubies/ruby-2.2.0/bin
- /usr/local/bin
- /usr/bin
- /usr/local/sbin
- /usr/sbin
- /home/abod/.rvm/bin
- /home/abod/.rvm/bin
At the suggestion of #joelparkerhenderson, here are the output of some commands that may be helpful.
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 2063389
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 32768
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 2063389
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ uname -a
Linux biohen36 3.14.23-100.fc19.x86_64 #1 SMP Thu Oct 30 18:36:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ stat /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
File: ‘/home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec’
Size: 1025 Blocks: 8 IO Block: 1048576 regular file
Device: 2fh/47d Inode: 2285894 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 730/ abod) Gid: ( 1013/ wommack)
Access: 2015-02-03 01:12:35.573192019 -0500
Modify: 2015-02-02 13:53:41.227813208 -0500
Change: 2015-02-02 13:53:41.227813208 -0500
Birth: -
$ fuser -m /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
/home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec: 57788c
There were more processes accessing the file, but I killed them and tried to install again, but I still got the lock error. I'm not out of disk space either.
Here is some more info:
This is on a compute cluster. The home directory /home/abod is symlinked somewhere on /mnt which mounts to some other machine on the network.
The output from mount has been requested by a few commenters. Here are the lines regarding the home directory:
fileserver:/homes on /home type nfs (rw,noatime,nodiratime,vers=3,rsize=1048576,wsize=1048576,namlen=255,soft,nocto,noacl,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=128.175.xxx.xxx,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=128.175.xxx.xxx)
-hosts on /net/fileserver/homes type autofs (rw,relatime,fd=13,pgrp=1368,timeout=300,minproto=5,maxproto=5,offset)
fileserver:/homes on /net/fileserver/homes type nfs (rw,nosuid,nodev,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=128.175.xxx.xxx,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=128.175.xxx.xxx)
Edit
I found this ticket on the rubygems github page that is related to my issue: https://github.com/rubygems/rubygems/issues/1176
Note: I'm offering a bounty to help the OP, because we need more expert help.
Here are some general ideas to get you started...
Is it possible that you're out of system resources, such as disk space?
Or your system is limiting the resources you can use?
Or trying to write to a volume where you don't have permissions or a lock daemon?
If no one has a better answer for you, by the time you read this, can you try running these commands then post the output in your question?
$ df
$ ulimit -a
$ uname -a
$ stat /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
$ fuser -m /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
If you want to kill any process accessing that file, that may be holding locks:
$ fuser --kill /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec
You can discover if the issue is with Ruby vs. gem by running this:
path = "/home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec"
f = File.open(path, File::RDWR|File::CREAT, 0644){|f|
f.flock(File::LOCK_EX)
f.flock(File::LOCK_UN)
}
If the above code fails, then the most likely explanation is that you're using a filesystem that doesn't support file locking. This would be consistent with your home directory being mounted to some other filesystem, such as using NFS without a lock daemon.
Edit: OP writes:
Running the code you suggest: test.rb:4:in flock': No locks available # rb_file_flock - /home/abod/.gem/specs/api.rubygems.org%443/quick/Marshal.4.8/bundler-1.7.12.gemspec (Errno::ENOLCK) from test.rb:4:inblock in ' from test.rb:3:in open' from test.rb:3:in'
That looks to me like your filesystem doesn't provide locking.
I have two suggestions and I'm also adding a bounty to your question to help attract expert attention.
If you have any filesystem space on that computer that isn't a mounted compute cluster, try installing a gem there. You can set the GEM_HOME environment variable like this:
GEM_HOME=/foo/bar gem install <name>
If you can use a similar system, such as the same OS on VirtualBox or VMWare, then you can use the bundler gem, a Gemfile, and the command bundle pack. This creates a directory full of the gems listed in the Gemfile. You can then copy this directory anywhere you want, for example by using rsync, or scp, or sftp, etc. (This doesn't help much though with native gems, such as pg for PostgreSQL - you would need to be sure to install all the PostgresSQL dependencies and headers on your own).
Ask your Sys Admin to unmount and mount the partition; the NFS Lock Daemon messes up at times and this will reset it.
(Not exactly an elegant or long-term solution, I know).
Related
I am trying to program my STM32 via PlatformIO. I am using the built in blink example so I 'know; that my code is not what is causing the issue. I am using macOS - M1 Max - Monterey(12.13.1).
Here is the board I am using: https://ubld.it/products/stm32-midi-dev
The program builds just fine, but when trying to upload, I get the following error:
dyld[54244]: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/***/.platformio/packages/tool-stm32duino/dfu-util/dfu-util
Reason: tried: '/opt/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file)
/Users/***/.platformio/packages/tool-stm32duino/maple_upload: line 53: 54244 Abort trap: 6 ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
*** [upload] Error 134
My platformio.ini file is as follows:
[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = arduino
board_build.core = maple
upload_protocol = dfu
I have tried the following:
brew install libusb - but it was already installed
brew uninstall libusb - then - brew install libusb
Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError) - This seemed to be more SSL related, but tried anyways
I have read the error message and understand that it appears that a file does not exist, but unsure of what next steps would be as I tried reinstalling libusb above.
Here is my full upload output if helpful:
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103CB.html
PLATFORM: ST STM32 (15.3.0) > STM32F103CB (20k RAM. 128k Flash)
HARDWARE: STM32F103CBT6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
- framework-arduinoststm32-maple # 3.10000.201129 (1.0.0)
- tool-dfuutil # 1.9.211020
- tool-openocd # 2.1100.211028 (11.0)
- tool-stm32duino # 1.0.1
- toolchain-gccarmnoneeabi # 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://docs.platformio.org/en/latest/librarymanager/ldf.html
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/genericSTM32F103CB/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 21.1% (used 4312 bytes from 20480 bytes)
Flash: [= ] 14.3% (used 18712 bytes from 131072 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = dfu
Looking for upload port...
Auto-detected: /dev/cu.usbmodem1101
Uploading .pio/build/genericSTM32F103CB/firmware.bin
Failed to open serial device.
dyld[54773]: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/***/.platformio/packages/tool-stm32duino/dfu-util/dfu-util
Reason: tried: '/opt/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file)
/Users/***/.platformio/packages/tool-stm32duino/maple_upload: line 53: 54773 Abort trap: 6 ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
*** [upload] Error 134
Thanks in advance for the help. Pretty new to embedded.
=== EDIT ===
As I continue to research, I think it is related to homebrew not installing in the normal spot for libusb. Homebrew Mac M1 can't find installs
Ok. Thanks to Ivan at PlatformIO, he was able to give me the below resolution. It now works great.
There are no new versions of STM32Duino /dfu-binaries for macOS ARM:
https://github.com/stm32duino/Arduino_Tools/tree/main/macosx/dfu-util
Could I ask you to try the next things?
Edit ~/.platformio/packages/tool-stm32duino/maple_upload
Comment line 43 and add a new one below
DFU_UTIL=~/.platformio/packages/tool-dfuutil/bin/dfu-util
I want to use TLS with Redis on Mac (macOS 10.15.4, kernel: Darwin 19.4.0). This is what I tried according to Documentation:
export BUILD_TLS=yes
mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make BUILD_TLS=yes
make test
sudo make install
All tests passed but when I run:
% redis-server --tls-cluster yes
I get error:
*** FATAL CONFIG FILE ERROR (Redis 6.0.4) *** Reading the configuration file, at line 2
>>> 'tls-cluster "yes"'
Bad directive or wrong number of arguments
Give a try to brew install redis (currently in version 6.0.5) it includes already support for TLS, in any case, if you would like to compile it from the source you could check the brew formula: https://github.com/Homebrew/homebrew-core/blob/master/Formula/redis.rb#L18
def install
system "make", "install", "PREFIX=#{prefix}", "CC=#{ENV.cc}", "BUILD_TLS=yes"
%w[run db/redis log].each { |p| (var/p).mkpath }
# Fix up default conf file to match our paths
inreplace "redis.conf" do |s|
s.gsub! "/var/run/redis.pid", var/"run/redis.pid"
s.gsub! "dir ./", "dir #{var}/db/redis/"
s.sub! /^bind .*$/, "bind 127.0.0.1 ::1"
end
etc.install "redis.conf"
etc.install "sentinel.conf" => "redis-sentinel.conf"
end
You did not specify the value for the tls-cluster configuration option. This works (on my MacBook Catelina 10.15.5):
% redis-server --tls-cluster yes
When running the analyze.rb script from Univa Grid Engine Open Core , I get a TypeError:
$ ./analyze.rb
./analyze.rb:214:in `<main>': superclass mismatch for class Queue (TypeError)
The script was developed for Ruby 1.8.1, but I am using a more recent version:
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
$ uname -a
Linux <hostname> 2.6.32-642.4.2.el6.x86_64 #1 SMP Mon Aug 15 02:06:41 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
$ head -n1 /etc/issue
Red Hat Enterprise Linux Server release 6.8 (Santiago)
I've opened a GitHub issue, but the last activity on the repro was from 6 years ago, so that's why I am also asking here.
Edit:
If I downgrade my Ruby version to 1.9.3, the TypeError dissapears...
$ conda uninstall ruby
Fetching package metadata .......
Solving package specifications: ..........
Package plan for package removal in environment /tools/general/app/anaconda-python-3.4/envs/accounting:
The following packages will be REMOVED:
ruby: 2.2.3-0 bioconda
Proceed ([y]/n)? y
Unlinking packages ...
[ COMPLETE ]|###############################################################################################################| 100%
$ conda install -c kalefranz ruby=1.9
Fetching package metadata .........
Solving package specifications: ..........
Package plan for installation in environment /tools/general/app/anaconda-python-3.4/envs/accounting:
The following packages will be downloaded:
package | build
---------------------------|-----------------
libffi-3.2.1 | 1 38 KB
ncurses-5.9 | 5 640 KB kalefranz
ruby-1.9.3.551 | 0 12.8 MB kalefranz
------------------------------------------------------------
Total: 13.4 MB
The following NEW packages will be INSTALLED:
libffi: 3.2.1-1
ncurses: 5.9-5 kalefranz
ruby: 1.9.3.551-0 kalefranz
Proceed ([y]/n)? y
Fetching packages ...
libffi-3.2.1-1 100% |############################################################################################| Time: 0:00:00 852.02 kB/s
ncurses-5.9-5. 100% |############################################################################################| Time: 0:00:01 504.77 kB/s
ruby-1.9.3.551 100% |############################################################################################| Time: 0:00:22 606.26 kB/s
Extracting packages ...
[ COMPLETE ]|###############################################################################################################| 100%
Linking packages ...
[ COMPLETE ]|###############################################################################################################| 100%
$ ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ ruby ./analyze.rb
usage: analyze.rb <options> accounting_file
-help
-r records table
-u users table
-h hosts table
-par parallel environment table
-q queues table
-p projects table
-c categories table
-ts timesteps table
-ts_c categories per timestep
-ts_j jobs per timestep
-t "first"|<first> "last"|<last> full analysis, but print these timesteps only
...but as soon as I try to process the accounting file, other errors pop up:
$ ./analyze.rb -ts /gridware/uge/default//common/accounting
invalid record 14473350 submitted 1503752102682 started 0 ended 0 wallclock 0
invalid record 14473350 submitted 1503752102682 started 0 ended 0 wallclock 0
invalid record 14473350 submitted 1503752102682 started 0 ended 0 wallclock 0
invalid record 14473350 submitted 1503752102682 started 0 ended 0 wallclock 0
invalid record 14473350 submitted 1503752102682 started 0 ended 0 wallclock 0
./analyze.rb:151:in `split': invalid byte sequence in UTF-8 (ArgumentError)
from ./analyze.rb:151:in `block in initialize'
from ./analyze.rb:149:in `each_line'
from ./analyze.rb:149:in `initialize'
from ./analyze.rb:557:in `new'
from ./analyze.rb:557:in `read_records'
from ./analyze.rb:774:in `<main>'
The script adds a class Queue like this:
class Queue < Debitable
end
Ruby 2.1 introduced its own Queue class which inherits from Object. This leads to the error you mention.
Following script demonstrates the problem:
class Thing < Object
end
class Thing < String
end
If you run it then Ruby will tell you that it has a superclass mismatch for class Thing (TypeError)
Two ways to solve this:
Use Ruby < 2.1 so the Queue class does not exist (which is kind of sad and not recommended)
update the script, replace all occurences of Queue with MyQueue (you are free to come up with a better name)
Potentially a 6 year old script contains other problems as well... so good luck.
Also: if you really need different ruby version you can look at a ruby version manager like RVM or RBEnv.
After upgrading Mac OS X to newest version Mavericks, I attempted to selfupdate my Macports, but it failed:
$ sudo port -v selfupdate
---> Updating MacPorts base sources using rsync
receiving file list ... done
sent 36 bytes received 69 bytes 210.00 bytes/sec
total size is 4925440 speedup is 46908.95
receiving file list ... done
sent 36 bytes received 76 bytes 74.67 bytes/sec
total size is 512 speedup is 4.57
MacPorts base version 2.2.0 installed,
MacPorts base version 2.2.1 downloaded.
---> Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
receiving file list ... done
sent 36 bytes received 70 bytes 70.67 bytes/sec
total size is 57702400 speedup is 544362.26
receiving file list ... done
sent 36 bytes received 77 bytes 75.33 bytes/sec
total size is 512 speedup is 4.53
receiving file list ... rsync: change_dir "tarballs/PortIndex_darwin_13_i386" (in release) failed: No such file or directory (2)
done
sent 4 bytes received 9 bytes 26.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(1400) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/PortIndex_darwin_13_i386/PortIndex /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 23
---> MacPorts base is outdated, installing new version 2.2.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking MacPorts version... 2.2.1
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.9
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 5.0.1
checking for gcc... /usr/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
<snip>
checking CommonCrypto/CommonDigest.h presence... yes
checking for CommonCrypto/CommonDigest.h... yes
checking for readline in -lreadline... yes
checking whether rl_username_completion_function is declared... no
checking whether rl_filename_completion_function is declared... yes
checking whether rl_completion_matches is declared... yes
checking whether username_completion_function is declared... yes
checking whether filename_completion_function is declared... yes
checking whether completion_matches is declared... yes
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 OBJC=/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 SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 1
Error: Error installing new MacPorts base: command execution failed
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
$
If I just try to upgrade a particular port, it failed too:
$ sudo port upgrade emacsapp
Password:
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
Error: emacsapp is not installed
$ sudo port search emacs
Password:
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
$ sudo port upgrade emacs-app
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
---> Fetching archive for gperf
---> Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://packages.macports.org/gperf
---> Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/gperf
---> Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/gperf
---> Fetching distfiles for gperf
---> Attempting to fetch gperf-3.0.4.tar.gz from http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/gperf
---> Verifying checksums for gperf
---> Extracting gperf
Error: org.macports.extract for port gperf returned: command execution failed
Please see the log file for port gperf for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gperf/gperf/main.log
Error: Problem while installing gperf
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
$
Any idea
if this is caused by incompatibility between OS X Mavericks and Macports?
how to fix it?
Edit:
I tried a different computer upgrading it from 10.8.5 to 10.9, and then try to do selfupdate for macports, it did not work again but gave a different error:
$ sudo port -v selfupdate
---> Updating MacPorts base sources using rsync
receiving file list ... done
base.tar
sent 13396 bytes received 10355 bytes 15834.00 bytes/sec
total size is 4925440 speedup is 207.38
receiving file list ... done
base.tar.rmd160
sent 64 bytes received 635 bytes 1398.00 bytes/sec
total size is 512 speedup is 0.73
MacPorts base version 2.2.1 installed,
MacPorts base version 2.2.1 downloaded.
---> Updating the ports tree
Synchronizing local ports tree from file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/
svn: E155036: Please see the 'svn upgrade' command
svn: E155036: Working copy '/opt/local/var/macports/sources/svn.macports.org/trunk/dports' is too old (format 10, created by Subversion 1.6)
Command failed: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports
Exit code: 1
Error: Synchronization of the local ports tree failed doing an svn update
Error: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
Install the "Command Line Tools" first:
sudo xcode-select --install
(Explicitly agreeing to the license is sometimes necessary via "sudo xcodebuild -license")
Then upgrade the ports:
sudo port -v selfupdate
I answered a similar question. The location of the Tcl framework has changed, breaking the existing MacPorts infrastructure. The 2.2.1 installer for Mavericks has since become available here. Make a list of your installed ports, and consider deleting /opt/local prior to installing. You will likely need to 'update' everything anyway.
There might be a chance that you haven't agreed with the XCode license.
If xcode-install doesn't help, you can run the belowing command to agree with Xcode license.
sudo xcodebuild -license
there is an actual bug with
gperf #3.0.4: error: expected parameter declarator
thankfully this issue has its own ticket at MacPorts ticket 40918
if anything you could read all the issues in Mavericks at http://trac.macports.org/wiki/MavericksProblems
I had the same issue. I am assuming that you had Xcode command line utils installed previously. Just launch XCODE and let it finish configuration. Now rerun port command and it should work properly.
I got an error with selfupdate, and resolved it by doing a fresh installation of MacPorts from http://www.macports.org/install.php. Now I can run the selfupdate command without error and install other ports.
The error I were seeing was below, it seems the same problem as Yo Sophia has pointed out:
$ sudo port selfupdate
Password:
---> Updating MacPorts base sources using rsync
MacPorts base version 2.1.3 installed,
MacPorts base version 2.2.1 downloaded.
---> Updating the ports tree
---> MacPorts base is outdated, installing new version 2.2.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
I mainly wanted to comment on #Brett's answer above (sorry, SO n00b still, not allowed) and share my experience upgrading... not really a new answer, but hopefully some useful info.
I downloaded and installed the Mavericks MacPorts installer as described above, (but without removing /opt, as suggested by #King Julian did self update which was fine, and then upgrade outdated and it seems to be uninstalling and reinstalling all my ports with a message:
Warning: Deactivate forced. Proceeding despite dependencies.
on each one. Luckily i made a copy of the etc and apache2/conf dirs, so should be able to get my config back when it eventually finishes... after 30 minutes or so it threw an error
Unable to open port: extra characters after close-quote
So i did self update again and upgrade outdated seems to run again...
So looks like it can be done (LAMP all working anyway) - it might have been quicker to start again from scratch, but make sure you have at least a couple of hours spare for this (and be connected to mains power ;)
Apologies if too much info, but hope it helps!
The problem seems to be with Macports and the location of the Tcl framework and it's path once Xcode has been installed. I suggest installing a fresh version of Macports for Mavericks here : http://www.macports.org/install.php.
I had this issue on Mountain Lion and it was actually to do with MacPorts looking at an old XCode path (I had several versions including betas installed). I ran with the -d option and checked the config.log file at /opt/local/var/macports/sources/rsync.macports.org/release/base and it reported some errors:-
--- snip ---
...
configure:3331: checking for C compiler version
configure:3340: gcc --version >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
configure:3351: $? = 0
configure:3340: gcc -v >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
...
--- snip ---
So I gave it the correct path using:-
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
and that fixed it.
I got my clues from this useful page.
I'm new to Ruby and working with the terminal. I installed the rvm, but I can't seem to be able to install Ruby 1.9.3. The problem seems to be with rsync and synching the ports tree. I have no idea what this means.
I tried looking up other solutions, but none of them are pertinent to rvm(that I could understand. They all just focused on autoupdated macports through itself). I also saw things about proxys, but I have no idea what I'd need to do if that was true. They all mainly focus on macports, and surround using words like "sudo" or -d, which I don't know how to do when just trying to install Ruby. Here is what I get:
$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.9.3-p429.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Installing macports............................................................................................................................................................................................................................................................................................................................Password:
.............................................................................................................................................................................................................................................
DEBUG: Copying /Users/Elvis/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
receiving file list ... done
base.tar
sent 58 bytes received 955032 bytes 272882.86 bytes/sec
total size is 3594240 speedup is 3.76
receiving file list ... done
base.tar.rmd160
sent 58 bytes received 635 bytes 1386.00 bytes/sec
total size is 512 speedup is 0.74
DEBUG: successful verification with key /opt/local/share/macports/macports-pubkey.pem
DEBUG: /usr/bin/tar -C /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/tmp -xf /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base.tar
MacPorts base version 2.1.3 installed,
DEBUG: Rebuilding and reinstalling MacPorts if needed
MacPorts base version 2.1.3 downloaded.
---> Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
DEBUG: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/ports.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list ... done
ports.tar
WARNING: ports.tar failed verification -- update discarded (will try again).
rsync: read errors mapping "/tarballs/ports.tar" (in release): No data available (61)
ports.tar
sent 80 bytes received 11948570 bytes 682780.00 bytes/sec
total size is 53186560 speedup is 4.45
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(1400) [generator=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/ports.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 23
Error: Synchronization of the local ports tree failed doing rsync
DEBUG: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /Users/Elvis/.rvm/bin/port: port selfupdate failed: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
Elviss-MacBook-Pro:~ Elvis$ ./port -d selfupdate
-bash: ./port: No such file or directory
I tried using some of the keywords/answers I saw online at the end, which explains the ./port line. I've installed command lines from xcode. Would installing homebrew help fix this problem? I'd appreciate any kind of help!
make sure the following command runs properly
port selfupdate
and then try again