我不想要“rake install”发布到 Rubygems

发布于 2025-01-05 02:20:51 字数 253 浏览 2 评论 0原文

我正在运行:

rake install

在使用 bundle gem 构建的项目上,

我已将 gem 发布到 Rubygems。然而,有时我使用 VPN,并且不希望 rake install 尝试将 gem 发布到 Rubygems。

我只想将其安装在本地。我怎样才能做到这一点?

I'm running:

rake install

on a project built with bundle gem <project_name>

I've published the gem to Rubygems. However, sometimes I'm on a VPN and I don't want rake install to try to also publish the gem to Rubygems.

I just want it installed locally. How can I achieve that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南风几经秋 2025-01-12 02:20:51

当您运行 rake install 时,bundler 创建的 rakefile 不会发布您的 gem。

您正在考虑rake release,不要忘记您可以执行rake -T来查看所有描述的任务的列表。

$ bundle --version
Bundler version 1.0.21


$ bundle gem somegem
      create  somegem/Gemfile
      create  somegem/Rakefile
      create  somegem/.gitignore
      create  somegem/somegem.gemspec
      create  somegem/lib/somegem.rb
      create  somegem/lib/somegem/version.rb
Initializating git repo in /Users/joshuajcheek/deleteme/somegem


$ cd somegem
total 24
-rw-r--r--  1 staff    91B Feb 12 22:00 Gemfile
-rw-r--r--  1 staff    28B Feb 12 22:00 Rakefile
drwxr-xr-x  4 staff   136B Feb 12 22:00 lib/
-rw-r--r--  1 staff   793B Feb 12 22:00 somegem.gemspec


$ rake -T
rake build    # Build somegem-0.0.1.gem into the pkg directory
rake install  # Build and install somegem-0.0.1.gem into system gems
rake release  # Create tag v0.0.1 and build and push somegem-0.0.1.gem to Rubygems


$ mate . # removing TODOs from the .gemspec


$ rake install # notice this is not pushing to rubygems
somegem 0.0.1 built to pkg/somegem-0.0.1.gem
somegem (0.0.1) installed


$ gem list somegem

*** LOCAL GEMS ***

somegem (0.0.1)


$ gem search -r somegem # does not show up in rubygems list

*** REMOTE GEMS ***

The rakefile created by bundler will not publish your gem when you run rake install.

You are thinking of rake release Don't forget that you can do rake -T to see a list of all described tasks.

$ bundle --version
Bundler version 1.0.21


$ bundle gem somegem
      create  somegem/Gemfile
      create  somegem/Rakefile
      create  somegem/.gitignore
      create  somegem/somegem.gemspec
      create  somegem/lib/somegem.rb
      create  somegem/lib/somegem/version.rb
Initializating git repo in /Users/joshuajcheek/deleteme/somegem


$ cd somegem
total 24
-rw-r--r--  1 staff    91B Feb 12 22:00 Gemfile
-rw-r--r--  1 staff    28B Feb 12 22:00 Rakefile
drwxr-xr-x  4 staff   136B Feb 12 22:00 lib/
-rw-r--r--  1 staff   793B Feb 12 22:00 somegem.gemspec


$ rake -T
rake build    # Build somegem-0.0.1.gem into the pkg directory
rake install  # Build and install somegem-0.0.1.gem into system gems
rake release  # Create tag v0.0.1 and build and push somegem-0.0.1.gem to Rubygems


$ mate . # removing TODOs from the .gemspec


$ rake install # notice this is not pushing to rubygems
somegem 0.0.1 built to pkg/somegem-0.0.1.gem
somegem (0.0.1) installed


$ gem list somegem

*** LOCAL GEMS ***

somegem (0.0.1)


$ gem search -r somegem # does not show up in rubygems list

*** REMOTE GEMS ***
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文