Google_drive gem在oAuth2身份验证上崩溃

时间:2016-05-11 21:29:18

标签: ruby google-drive-api rubygems

在Google云端硬盘上我曾经使用config.json进行身份验证,例如gem readme suggests

#include <iostream>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <cstdlib>  
#include <vector>
#include <map>
#include <algorithm>
#include <list>
//#include <Winbase.h>

using namespace std;

// A struct describing a product.
typedef struct Products
{
    string category;
    string name;
    float price;
} Product;

inline void scenario1(int num_cashiers)
{
    vector<Product> products; // It is a vector(a pseudo-second dimension) of products which will be used for each customer
    vector<vector<Product>> customers; // A vector containing all customers
    vector<vector<vector<Product>>> cashiers(num_cashiers); // A vector describing the supermarket cashiers declaring a queue of customers for each cashier
    double start = GetTickCount(); // It will be used for counting 10 secs until next update
    vector<int> total_products(num_cashiers); // A vector keeping the total number of products of each queue
    list<string> categories; // A list containing all the categories of the products
    list<float> categories_prices(categories.unique().size()); // A list containing all category prices
    //THE ABOVE LINE - THE LAST ONE IN THIS PART OF CODE - IS THE LINE I GET THE ERROR!!!
    ....

}

但我在oAuth2身份验证上遇到错误:

  

/usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:2283:in"pree_if_conflicts':无法激活oauth2-1.1.0,因为jwt-1.5.4与jwt(&lt; 1.5.2,〜> 1.0)(Gem :: ConflictError)

任何人都可以帮助我?

谢谢!

1 个答案:

答案 0 :(得分:0)

不确定你是否曾经过这个,但在遇到类似问题时我遇到了这个问题。

我一直在尝试gem list来验证我有正确版本的oauth2和jwt,我做到了。

我的解决方案是我运行的脚本显然是通过rvm访问不同版本的ruby,后者安装了不同的jwt gem版本。 1.5.4

一旦我做了rvm use ruby-2.3.0 jwt-1.5.4,我就能gem uninstall jwt -v 1.5.4。然后回到rvm use ruby-2.1.5这是我的默认值,我能够毫无问题地运行所有内容。