Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 Omniauth+设计错误:找不到hashie-1.2.0_Ruby On Rails 3_Devise_Omniauth - Fatal编程技术网

Ruby on rails 3 Omniauth+设计错误:找不到hashie-1.2.0

Ruby on rails 3 Omniauth+设计错误:找不到hashie-1.2.0,ruby-on-rails-3,devise,omniauth,Ruby On Rails 3,Devise,Omniauth,我将此添加到文件中: gem 'omniauth-facebook' 然后我运行bundle更新。到目前为止没有问题。但是,当我运行rails服务器时,会出现以下错误: Could not find hashie-1.2.0 in any of the sources Run `bundle install` to install missing gems. 我认为bundler应该解决并满足所有依赖项,但我还是尝试了以下方法: gem install hashie-1.2.0 这使得:

我将此添加到文件中:

gem 'omniauth-facebook'
然后我运行bundle更新。到目前为止没有问题。但是,当我运行rails服务器时,会出现以下错误:

Could not find hashie-1.2.0 in any of the sources
Run `bundle install` to install missing gems.
我认为bundler应该解决并满足所有依赖项,但我还是尝试了以下方法:

gem install hashie-1.2.0
这使得:

ERROR:  Could not find a valid gem 'hashie-1.2.0' (>= 0) in any repository
ERROR:  Possible alternatives: hashie-model
我是Rails的新手,我觉得自己已经走到了死胡同。建议

更新:我还运行了bundle安装,以实现精确的bundle安装-多次没有生产。之后运行rails服务器时也会出现同样的错误


更新:我还尝试在omniauth facebook之前在gem文件中添加gem'hashee'。运气不好。

所以我认为你只是用错了邦德

bundle update不会解析新的依赖项,它只是查看gem清单,该清单存储在Gemfile.lock中,并根据Gemfile中的约束将这些gem更新为最新的gem allow

由于您正在尝试安装一个新的gem,您要运行的是bundle install,它将在您的Gemfile和Gemfile.lock之间进行比较,并安装Gemfile.lock中未列出的任何gem

我认为bundle安装应该能帮到你


作为补充说明,bundler试图通过将bundle别名为bundle-to-bundle-install来尽可能简化这一过程。因此,除非您明确希望更新gems,否则您只需键入bundle并获得您期望的行为。

我让它工作起来了。我想这是bundler的问题。我做了一些不同的事情,我不得不承认我不能100%确定是什么修复了它。我想是这样的:

gem uninstall bundler
gem install bundler
bundle install mail

然而,我想直到我的第二次重新安装它才起作用。在执行install命令时,它安装了所有内容,而不仅仅是邮件及其依赖项。我做的另一件事是在第一次重新安装后删除/usr/bin/bundler。它没有再次出现。

很抱歉,我没有提供足够的信息。我运行bundle安装,然后运行bundle更新。我做了很多次。同样的错误。啊,好的,很有趣。那么,在这种情况下,在omniauth facebook之前将hashie添加到您的GEM文件中。gem'hashie',“~>1.2.0”是的,我也试过了,只是我用了版本号,并在文件末尾做了。在任何情况下,我都像你说的那样尝试了,但我仍然得到了错误。更新:当我推到Heroku时,它是好的。我猜在我的环境中有些东西被破坏了。建议如何找出什么?以下是一些基本的环境信息:[Rails 3.2.2 | ruby 1.9.3p0 2011-10-30修订版33570[x86_64-darwin11.3.0]| gem 1.8.10 | Bundler版本1.0.22]