简体   繁体   English

无法访问最新版本的GitHub gem中的功能

[英]Cannot access function in latest version of GitHub gem

I am trying to use the MindBody Gem but when I attempt to run: $ gem install mindbody-api I see the error: 我正在尝试使用MindBody Gem,但是当我尝试运行时: $ gem install mindbody-api我看到错误:

$ gem install mindbody-api
ERROR:  Could not find a valid gem 'mindbody-api' (>= 0) in any repository

I've been able to get it working in my gemfile by including the path of the GitHub page: gem 'mindbody-api', :git => 'git://github.com/wingrunr21/mindbody-api.git' and I am successful when I run bundle install but I've noticed that my version is missing a function that is present in the GitHub Repo, specifically: 通过包含GitHub页面的路径,我已经能够使其在我的gemfile中工作:gem'mindbody gem 'mindbody-api', :git => 'git://github.com/wingrunr21/mindbody-api.git'和我运行bundle install时成功,但是我注意到我的版本缺少GitHub Repo中提供的功能,特别是:

MindBody::Services::SaleService.checkout_shopping_cart(search_creds)
NoMethodError: undefined method `checkout_shopping_cart' for MindBody::Services::SaleService:Class

despite the function being listed on the GitHub repo SaleService page . 尽管该功能已在GitHub repo SaleService页面上列出。 Any idea what I should try next? 知道下一步该怎么做吗?

In your comment under the question it shows that you have older version of the gem: rvm/gems/ruby-2.2.3@awaken/bundler/gems/mindbody-api-579af18314d2 . 在问题下的注释中,它表明您使用的是gem的旧版本: rvm/gems/ruby-2.2.3@awaken/bundler/gems/mindbody-api-579af18314d2

So if you browse the repo at this point of time ( 579af18314d2 ) you will see that the method does not exist yet - link 因此,如果您在这个时间点( 579af18314d2 )浏览存储库,您将看到该方法尚不存在- 链接

In order to fix it you need to update it to thelatest version, which you can do by: 为了修复它,您需要将其更新到最新版本,您可以通过以下方法进行操作:

bundle update --source mindbody-api

Also to verify that you have the latest version when you do bundle show mindbody-api it should show something like: .rvm/gems/ruby-2.2.3@awaken/bundler/gems/mindbody-api-f58110f2b255 另外,在bundle show mindbody-api时,还要验证您是否具有最新版本,它应显示如下内容: .rvm/gems/ruby-2.2.3@awaken/bundler/gems/mindbody-api-f58110f2b255

Regarding the install: 关于安装:

The only version released is an alpha release, that's why you can't install it. 唯一发布的版本是Alpha版本,这就是为什么您不能安装它的原因。 You can, however, install the alpha version with: 但是,您可以使用以下命令安装Alpha版本:

gem install mindbody-api -v 1.0.1.alpha

Regarding the method missing: 关于缺少的方法:

It appears there is a bug in the way the operations are loaded. 似乎加载操作的方式存在错误。 I was able to get the method loaded under certain circumstances (cloning & building myself, I think) but even then the behavior wasn't consistent. 我能够在某些情况下加载方法(我认为是克隆并构建自己),但是即使那样,行为也不是一致的。

The gem hasn't had any significant major updates in a few years. 这颗宝石几年来没有任何重大的重大更新。 It's not clear if the gem is maintained but I think your best bet might be to create a github repo issue, or fork & fix it yourself. 目前尚不清楚gem是否得到维护,但我认为您最好的选择是创建一个github repo问题,或者自己分叉并修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM