- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在尝试围绕 C 扩展构建一个 ruby gem。使用 ruby extconf.rb 可以很好地编译 C 扩展;制作; sudo make install
例程,但是当我尝试使用 rake 构建 gem 时,该过程终止并出现此跟踪底部的错误。
我正在使用帖子 here ,具有相同的目录结构,以创建 gem。
我的配置有什么问题?我的 gemspec 和 Rakefile 位于跟踪下方(该 gem 称为 netconf)。
//跟踪
** Execute copy:netconf:i686-linux:1.9.2
install -c tmp/i686-linux/netconf/1.9.2/netconf.so lib/netconf/netconf.so
** Execute compile:netconf:i686-linux
** Execute compile:i686-linux
** Execute compile
** Invoke chmod (first_time)
** Execute chmod
** Execute build
rake aborted!
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
["extconf.rb", "netconf.o", "netconf.so"] are not files
//网络 session .gemspec
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "netconf/version"
Gem::Specification.new do |s|
s.name = "netconf"
s.version = Netconf::VERSION
s.authors = ["..."]
s.email = ["..."]
s.homepage = "..."
s.summary = %q{A tool to access and write Ubuntu network configuration}
s.description = %q{Uses ifconfig and other C system calls to access network configurations on a Ubuntu install.}
s.rubyforge_project = "netconf"
s.files = `git ls-files`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.extensions = ["ext/netconf/extconf.rb"]
end
//拉克文件
require 'rake'
require 'rake/extensiontask'
require 'bundler'
Rake::ExtensionTask.new("netconf") do |extension|
extension.lib_dir = "lib/netconf"
end
task :chmod do
File.chmod(0775, 'lib/netconf/netconf.so')
end
task :build => [:clean, :compile, :chmod]
Bundler::GemHelper.install_tasks
最佳答案
我收到这个错误是因为我还没有用 git 提交我的更新。
s.files = `git ls-files`.split("\n")
那一行是直接使用git,可能导致这个错误。就这样
git add .
git commit -a -m "init"
关于ruby - 执行 gem ... ["extconf.rb", ...] 不是文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6256743/
我正在按照 http://people.apache.org/~rooneg/talks/ruby-extensions/ruby-extensions.html 的说明进行操作(第 6 页)我的 m
我有一个像这样组织的 ruby 扩展的小项目: ./ Rakefile ext/ mymodule/ extconf.rb mymodule.rb
我正在为 Ruby 写一个 C 扩展,我在 extconf.rb 文件中有这样的东西: if(not have_library('z')) $stderr << "Error, cou
我正在编写一个 Ruby C 扩展。我将在 Windows 和 OSX 下编译它。 我无法解决的问题是控制 makefile 和所有其他生成文件的放置位置。 我的 extconf.rb 文件有根据操作
我刚刚将 gcc 从默认的 4.2.1 更新到 4.5。但是当我运行 ruby extconf.rb 时,我创建了一个 gcc 无法识别的警告标志。 cc1: error: unrecognize
我将 macos 升级到 Mojave 并重新安装了 xcode、xcode CLT、ruby 等。然后当我尝试时: gem install nokogiri 我收到以下错误(安装其他 gem 时出现
在我的 extconf.rb 中,我有 $srcs = %w{foo.cpp bar.cpp} $objs = %w{foo bar} 其中每一个都依赖于多个头文件。如果我touch foo.cpp
我正在编写一个 Ruby 扩展,为此我有一个标准的 mkmf 配置脚本,但我需要向所有 C++ 编译步骤添加一个特殊的包含标志 (--std=c++0x)。我不想在 C 编译步骤中使用它,因为它会引发
我正在尝试围绕 C 扩展构建一个 ruby gem。使用 ruby extconf.rb 可以很好地编译 C 扩展;制作; sudo make install 例程,但是当我尝试使用 rake 构
我已经坚持了几天了,所以请帮忙! 我运行 MAC OS X(10.7.5),安装了 Xcode(4.5.2) 和命令行工具。 ruby 1.9.3-p362,RVM 1.17.8。 apple-gcc
对此很陌生,所以我一直在尝试解决这个问题,但无法找到答案。 gem update --system 安装 rb-appscript 时出现以下错误。 gem install rb-appscript
我正在构建一个具有各种第 3 方可执行要求的 Ruby gem 文件(该 gem 将通过系统调用使用的一些非 ruby 工具)。 需求列表是使用 gemspec 信息指定的 requirement
我正在发布我的 Ruby C/C++ 扩展,并尝试确保所有需要的库都列在 extconf.rb 中。我一直无法弄清楚如何需要 boost 库,尤其是 dynamic_bitset<> 类。 到目前为止
我是 Ruby on Rails 的新手,在安装时出现以下错误。 请注意,我已经安装了最新的 Xcode 和命令行工具,并且我使用的是 OSX 10.8.4。我也安装了 Ruby 2.0.0。 -ba
假设我要用命令编译一个C文件 g++ a.cpp -I/usr/local/gr/include -L/usr/local/gr/lib -lGR -lm -Wl,-rpath,/usr/local
我在 Linux (CentOS) 系统中安装 PG 时遇到错误。 gem install pg 然后我得到以下错误 Building native extensions. This could t
我有一个带有 C 扩展和 Java 扩展的 gem,它可以通过 rbenv 在 JRuby 中正常安装,但无法通过 RVM 安装在 JRuby 中。 gemspec and project are o
我在安装 Rails 时生成可执行文件时遇到运行时错误。 gem install rails -- --use-system-libraries 我检查过类似的 thread在这里,但就我而言,似乎没
我正在使用 Rice为 Ruby gem 编写 C++ 扩展。扩展名采用共享对象 (.so) 文件的形式。 这需要“mkmf-rice”而不是“mkmf”,但两者 (AFAIK) 非常相似。 默认情况
找不到这个问题的答案。 运行 OS X Yosemite Beta v2 遵循 compass 安装指南时,请确保您的 gem 是最新的 gem update --system 然后运行 gem in
我是一名优秀的程序员,十分优秀!