我如何使用冷冻Capistrano第2部分?

时间:2021-09-10 07:24:16

Following on from my question on using frozen Capistrano a couple of days back I'm still having issues running Capistrano frozen in my vendor folder.

继我几天前使用冷冻Capistrano的问题之后,我仍然遇到在我的供应商文件夹中运行Capistrano的问题。

When I try and run my frozen version of cap

当我尝试运行我的冷冻版帽

ruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations

I get an error

我收到一个错误

... RubyGem version error: net-ssh(1.0.8 not >= 2.0.0) (Gem::LoadError) ...

I have net-ssh-2.0.4 frozen in my vendor folder as I knew it was a dependency so how do I make use of it?

我在我的供应商文件夹中冻结了net-ssh-2.0.4,因为我知道它是一个依赖项,所以我该如何使用它呢?

I'd hoped adding my vendor folder to my .gemrc file under the gempath: would have done the trick, but it hasn't. 'gem environment' shows the vendor path, but 'gem list' doesn't show the gems in the vendor folder.

我希望将我的供应商文件夹添加到gempath下的.gemrc文件中:本来可以做到这一点,但事实并非如此。 'gem environment'显示供应商路径,但'gem list'不显示vendor文件夹中的gem。

Any ideas?

2 个解决方案

#1


1  

In the end I decided not to freeze Capistrano and dependancies to my vendor gems directory as they weren't gems used by my application - they were used to deploy my application.

最后,我决定不将Capistrano和依赖关系冻结到我的供应商gems目录,因为它们不是我的应用程序使用的宝石 - 它们用于部署我的应用程序。

Instead I locally installed them on my hosting account and all worked fine.

相反,我在我的托管帐户本地安装它们,一切正常。

#2


0  

If you want to completely avoid the system-installed gems (which isn't a bad idea if you don't have control over them), I'd install a copy of rubygems to vendor directory.

如果你想完全避免系统安装的宝石(如果你不能控制它们,这不是一个坏主意),我会在供应商目录中安装一个rubygems副本。

Set GEM_PATH and GEM_HOME environment variables to /path/to/your/vendor/gems directory, and then install rubygems and go from there.

将GEM_PATH和GEM_HOME环境变量设置为/ path / to / your / vendor / gems目录,然后安装rubygems并从那里开始。

#1


1  

In the end I decided not to freeze Capistrano and dependancies to my vendor gems directory as they weren't gems used by my application - they were used to deploy my application.

最后,我决定不将Capistrano和依赖关系冻结到我的供应商gems目录,因为它们不是我的应用程序使用的宝石 - 它们用于部署我的应用程序。

Instead I locally installed them on my hosting account and all worked fine.

相反,我在我的托管帐户本地安装它们,一切正常。

#2


0  

If you want to completely avoid the system-installed gems (which isn't a bad idea if you don't have control over them), I'd install a copy of rubygems to vendor directory.

如果你想完全避免系统安装的宝石(如果你不能控制它们,这不是一个坏主意),我会在供应商目录中安装一个rubygems副本。

Set GEM_PATH and GEM_HOME environment variables to /path/to/your/vendor/gems directory, and then install rubygems and go from there.

将GEM_PATH和GEM_HOME环境变量设置为/ path / to / your / vendor / gems目录,然后安装rubygems并从那里开始。