Cocoapods: Can i running pod command on Linux OS?

Created on 15 Apr 2015  Â·  25Comments  Â·  Source: CocoaPods/CocoaPods

i tried execute 'pod update' on Linux, get following error message:

...
No such file or directory - sw_vers (Errno::ENOENT)
...

discussion

Most helpful comment

It's the same: ensure you have ruby, then run [sudo] gem install cocoapods

All 25 comments

I'm not sure why you would want to run pod update on Linux? Since CocoaPods is a package manager for Cocoa on iOS and OS X.

i’d auto generate pod files on Server through execute ’pod update’ and that the Podfile was also auto generated @kylef

@squarezw if you want to do that, you're best off writing your own Ruby script that uses Pod::Analyzer to generate a lockfile

Before throwing the towel in, it would be interesting to see what is depending on sw_vers for OS X version detection and if that’s really required for the task at hand.

It looks like that's actually in the error report. @squarezw can you share a full backtrace?

i rewrited 'xcode_information' and 'host_information' in cocoapods/user_interface/error_report.rb

def host_information
  product, version, build = ["Mac OS X", "10.10.2", "14C1514"]
  #product, version, build = `sw_vers`.strip.split("\n").map { |line| line.split(':').last.strip }
  "#{product} #{version} (#{build})"
end
def xcode_information
  version, build = ["6.2", "6C131e"]
  #version, build = `xcodebuild -version`.strip.split("\n").map { |line| line.split(' ').last }
  "#{version} (#{build})"
end

then retry 'Pod update' and get real error report:

### Error

Fiddle::DLError - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation: cannot open shared object file: No such file or directory
/opt/ruby21/lib64/ruby/2.1/fiddle.rb:46:in `initialize'
/opt/ruby21/lib64/ruby/2.1/fiddle.rb:46:in `new'
/opt/ruby21/lib64/ruby/2.1/fiddle.rb:46:in `dlopen'

@segiddins @alloy

Yeah, looks like Xcodeproj really wants CF to exist.

How to install CF to Linux OS? @segiddins

Well, we should probably find some way to fallback when we can't dlopen CoreFoundation @neonichu

See CocoaPods/Xcodeproj#204 and CocoaPods/Xcodeproj#168 for prior discussions. The latter was in a state where it did run on Linux at some point, I believe.

Having a third level of fallback seems like a bit of overkill to me.

You should be able to build CFLite for linux (i've worked with people that have done this and used it for plist serialization). That would require some OS level check and assume fallback library location.

Since Apple's open source site is currently displaying links to nonexistent packages:

Source: https://opensource.apple.com/source/CF/CF-855.17/
Tarball: https://opensource.apple.com/tarballs/CF/CF-855.17.tar.gz

These are the 10.9.5 sources, which should still work and be accurate for the purposes you want for anything newer.

Check this file (http://opensource.apple.com/source/CF/CF-855.17/README_CFLITE) for compilation instructions and default install paths so you can work out how to set this up.

I will try to do it with that info ! Thanks @samdmarshall

@squarezw Hey, when you get around to trying this out, can you please send a PR to make it work for the default prefix installation out-of-the-box when not on OS X?

How to do that send a PR? @alloy

Closing because making this work on Linux isn't a top priority at the moment, and was mostly academic in nature.

I have a private cocoapod (swift code autogenerated based on some specification file) and was trying automate the process of updating Podspec through a jenkins CI server (running in linux) when the swift code changes but this issue seems to make that impossible atm :(

One more guy here wants to update his Podspec through CI server installed on a Linux platform.
@segiddins do you think that this project is a low priority? We want to move to the CI and CD era here :)

@Md-Cake Linux support was added in CocoaPods 1.2.0.beta.1 (see CHANGELOG).

But, I do think that fully linting/publishing a pod spec will depend on Xcode and macOS. You should be able to use the pod command line tool on Linux though.

@kylef thank you :)

I don't this this issue deserved to be closed as an academic topic as there is a growing amount of people using server side swift with frameworks like Vapor on Linux :(

@rafiki270 you do understand that there is support for linux now in CocoaPods, right? The original issue is now resolved.

@samdmarshall could you provide a link to a description of how to install CocoaPods in Linux? The official documentation only seems to talk about macOS.

It's the same: ensure you have ruby, then run [sudo] gem install cocoapods

I had no idea! Amazing!

as it's the first thread that appears on google, is it possible to run "pod update" without the compilation phase ?
as for example glog will try to compile with xcrun , which will not work on linux

Note:
if you're a fellow guy with the same situation as me, a workaround is to edit
.node_modules/react-native/scripts/ios-configure-glog.sh and to replace the beginning with

#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -e

CURRENT_ARCH="x86_64"

export CC="cc"
export CXX="c++"

# Remove automake symlink if it exists
Was this page helpful?
0 / 5 - 0 ratings