- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个 gem(X) 并且它没有发布。现在我正在创建另一个 gem,它将 gem X 添加为这样的依赖项:-
s.add_dependency "X"
could not find the gem X**
最佳答案
我想我看到了@bor1s 在关于 git 引用的 SO 帖子中所指的内容。gemspec
文件是关于发布 gem 的依赖项。您的 Gemfile
设置您的本地开发环境,通常通过调用 gemspec
.
在您的情况下,您的 gemspec
应该有这个
s.add_dependency "X"
Gemfile
看起来像这样(确保本地引用在
gemspec
调用之后):
source "http://www.rubygems.org"
gemspec
gem "X", :path => "/Users/vikram/source/X"
If you find that you need to develop against a gem that hasn’t yet been released (for instance, Rails often develops against unreleased Rack, Arel, or Mail gems), you can add individual lines in the Gemfile that tell bundler where to find the gems. It will still use the dependencies listed in the .gemspec for dependency resolution, but it now knows exactly where to find the dependency during gem development.
source "http://www.rubygems.org"
gemspec
# if the .gemspec in this git repo doesn't match the version required by this
# gem's .gemspec, bundler will print an error
gem "rack", :git => "git://github.com/rack/rack.git"
You wouldn’t want to include this information in the .gemspec, which will eventually be released to Rubygems after the in-development gem has also been released. Again, this makes the overall system more resilient, as it doesn’t depend on transient external URLs. This information is purely something used to set up a complete environment during development, which requires some precision.
关于ruby-on-rails - 如何在 gemspec 文件中指定依赖 gem 的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11427922/
当您编写 gemspec 文件时,摘要和描述字段之间的实际区别是什么? 最佳答案 它们用在不同的地方。 summary 可以看到你执行 gem list -d,而 description 可以在 ht
当我从 github 安装 gem 时,它给了我错误: number_internationalizer at /usr/local/rvm/gems/ruby-1.9.3-p194@number_i
我正在编写一个依赖于另一个 gem X 的 gem,但是 X 具有与我的 gem 的依赖项冲突的过时依赖项。 (具体来说,multi_json-1.7.x和X的multi_json-1.1.x有冲突)
rubygems 想知道我的开发依赖项是什么,这似乎是一个奇怪的功能,到目前为止,我从未见过它用于在运行 gem 测试时实际加载这些依赖项。 最佳答案 如果有人出于某种原因决定破解您的 gem,例如他
当我在 Gemfile 中包含我制作的 gem 时,感谢 Bundler(版本 1.0.12),然后我尝试像这样 bundle 或抓取: $ 佣金 我收到此错误消息: Invalid gemspec
当我尝试在 Windows 中使用 gems 时,出现以下错误,我也提到了 this stackoverflow post并更新了 rubygems 和 Rails。但没有什么能解决问题。 以下是
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Meaning of tilde-greater-than (~>) in version requirem
当我尝试在 Windows 中使用 gems 时出现以下错误,我还提到了 this stackoverflow post并更新了 rubygems 和 rails。但没有什么能解决问题。 下面是完
bundler since v1.7当在 gemfile 中指定多个全局源时发出警告。您可以使用 source blocks指定哪些 gem 应该来自给定的来源,但是 source个别 gem 的选项
我正在构建一个使用 rails-assets-growl gem 的 gem。可以使用 不同于 'https://rubygems.org' 的源将此 gem 添加到我的 Gemfile,如下所示:
我正在构建一个需要安装 json gem 才能运行的 gem。哪个 json gem 并不重要:json_pure、json-jruby 或基于 C 的 json。 是否有在 gemspec 中定义它
有没有一种干净的方法可以从 .gemspec 文件中提取版本字符串? (gem 尚未安装) 例如somethingcool.gemspec 是 Gem::Specification.new do |s
我几乎做了所有的事情this instruction告诉我这样做,但我遇到了一系列错误。这是日志: stanley@ubuntu:~$ mkdir railstest stanley@ubuntu:~
对于 Linux 上的 Ruby 新用户来说,没有将 openssl 编译到他们的 Ruby 中是一个相对常见的错误。我们有一个需要'openssl'的gem,每隔一段时间它就会在'openssl'上
在过去的几个月里,Ruby 依赖管理和 gem 创建的状态有了一些快速的发展,以至于我一直难以跟上一切。 如果我正在编写一个新的 gem,我用来创建我的 gemspec 的最佳工具是什么?与竞争对手相
我的 gem 中需要私有(private) gem,并且 gemspec 依赖项不能包含 git 存储库。 所以我用 geminabox 启动了我的私有(private)服务器,并将源代码添加到我的
关于 gemspecs 的文件列表。 我注意到珠宝商使用项目中的文件列表手动更新此列表。例如 Gem::Specification.new do |s| # stuff s.files = [
每当开发 gems 时,我看不出有任何理由不直接检查 Gemfile 的依赖关系。 的确,为什么要使用 .gemspec 文件来列出它们?有真正的好处吗? 最佳答案 那是因为 Gemfile 不是来自
我正在开发一个 gem(Gem A),它使用我也编写的另一个 gem(Gem B)。至此 Gem B 已添加到 Gem A 的 gemspec 中: gem.add_dependency "gem_a
例如,给定 Gemspec 文件: $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: requir
我是一名优秀的程序员,十分优秀!