首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装后无法立即找到bcrypt

安装后无法立即找到bcrypt
EN

Stack Overflow用户
提问于 2014-11-18 17:22:47
回答 3查看 2.5K关注 0票数 1

在Rails4.1项目中,我只是添加了devise并运行bundle install。在那之后,由于缺少bcrypt,命令无法工作:

代码语言:javascript
复制
$ rails c
Could not find bcrypt-3.1.9 in any of the sources
Run `bundle install` to install missing gems.
$ rails generate devise:install
Could not find bcrypt-3.1.9 in any of the sources
Run `bundle install` to install missing gems.
$ bundle exec rails generate devise:install
Could not find bcrypt-3.1.9 in any of the sources
Run `bundle install` to install missing gems.

即使很明显它已经安装了:

代码语言:javascript
复制
$ bundle show
Gems included by the bundle:
  * actionmailer (4.1.8)
  * actionpack (4.1.8)
  * actionview (4.1.8)
  * activemodel (4.1.8)
  * activerecord (4.1.8)
  * activesupport (4.1.8)
  * arel (5.0.1.20140414130214)
  * bcrypt (3.1.9)
  * builder (3.2.2)
  * bundler (1.7.6)
  * coffee-rails (4.0.1)
  * coffee-script (2.3.0)
  * coffee-script-source (1.8.0)
  * devise (3.4.1)
  * domain_name (0.5.22)
  * erubis (2.7.0)
  * execjs (2.2.2)
  * haml (4.0.5)
  * haml-rails (0.5.3)
  * hike (1.2.3)
  * http-cookie (1.0.2)
  * i18n (0.6.11)
  * jbuilder (2.2.5)
  * jquery-rails (3.1.2)
  * json (1.8.1)
  * mail (2.6.3)
  * mechanize (2.7.3)
  * mime-types (2.4.3)
  * mini_portile (0.6.1)
  * minitest (5.4.3)
  * multi_json (1.10.1)
  * net-http-digest_auth (1.4)
  * net-http-persistent (2.9.4)
  * nokogiri (1.6.4.1)
  * ntlm-http (0.1.1)
  * orm_adapter (0.5.0)
  * pg (0.17.1)
  * rack (1.5.2)
  * rack-test (0.6.2)
  * rails (4.1.8)
  * railties (4.1.8)
  * rake (10.3.2)
  * rdoc (4.1.2)
  * responders (1.1.2)
  * sass (3.2.19)
  * sass-rails (4.0.4)
  * sdoc (0.4.1)
  * spring (1.1.3)
  * sprockets (2.11.3)
  * sprockets-rails (2.2.0)
  * thor (0.19.1)
  * thor-rails (0.0.1)
  * thread_safe (0.3.4)
  * tilt (1.4.1)
  * turbolinks (2.5.2)
  * tzinfo (1.2.2)
  * uglifier (2.5.3)
  * unf (0.1.4)
  * unf_ext (0.0.6)
  * warden (1.2.3)
  * webrobots (0.1.1)
$ bundle show bcrypt
/Users/pupeno/.rvm/gems/ruby-2.1.4@efc/gems/bcrypt-3.1.9

我的Gemfile看起来像这样:

来源:"https://rubygems.org

代码语言:javascript
复制
gem "coffee-rails", "~> 4.0.0"
gem "jbuilder", "~> 2.0"
gem "jquery-rails"
gem "rails", ">= 4.1.6"
gem "sass-rails", "~> 4.0.3"
gem "sdoc", "~> 0.4.0", group: :doc
gem "spring", group: :development
gem "pg"
gem "thor-rails"
gem "turbolinks"
gem "uglifier", ">= 1.3.0"
gem "mechanize"
gem "haml"
gem "haml-rails"
gem "devise"

我的Gemfile.lock是这样的:

代码语言:javascript
复制
GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.8)
      actionpack (= 4.1.8)
      actionview (= 4.1.8)
      mail (~> 2.5, >= 2.5.4)
    actionpack (4.1.8)
      actionview (= 4.1.8)
      activesupport (= 4.1.8)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.8)
      activesupport (= 4.1.8)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.8)
      activesupport (= 4.1.8)
      builder (~> 3.1)
    activerecord (4.1.8)
      activemodel (= 4.1.8)
      activesupport (= 4.1.8)
      arel (~> 5.0.0)
    activesupport (4.1.8)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    arel (5.0.1.20140414130214)
    bcrypt (3.1.9)
    builder (3.2.2)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.3.0)
      coffee-script-source
      execjs
    coffee-script-source (1.8.0)
    devise (3.4.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      responders
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    domain_name (0.5.22)
      unf (>= 0.0.5, < 1.0.0)
    erubis (2.7.0)
    execjs (2.2.2)
    haml (4.0.5)
      tilt
    haml-rails (0.5.3)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 3.1, < 5.0)
      railties (>= 4.0.1)
    hike (1.2.3)
    http-cookie (1.0.2)
      domain_name (~> 0.5)
    i18n (0.6.11)
    jbuilder (2.2.5)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (3.1.2)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    mechanize (2.7.3)
      domain_name (~> 0.5, >= 0.5.1)
      http-cookie (~> 1.0)
      mime-types (~> 2.0)
      net-http-digest_auth (~> 1.1, >= 1.1.1)
      net-http-persistent (~> 2.5, >= 2.5.2)
      nokogiri (~> 1.4)
      ntlm-http (~> 0.1, >= 0.1.1)
      webrobots (>= 0.0.9, < 0.2)
    mime-types (2.4.3)
    mini_portile (0.6.1)
    minitest (5.4.3)
    multi_json (1.10.1)
    net-http-digest_auth (1.4)
    net-http-persistent (2.9.4)
    nokogiri (1.6.4.1)
      mini_portile (~> 0.6.0)
    ntlm-http (0.1.1)
    orm_adapter (0.5.0)
    pg (0.17.1)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.1.8)
      actionmailer (= 4.1.8)
      actionpack (= 4.1.8)
      actionview (= 4.1.8)
      activemodel (= 4.1.8)
      activerecord (= 4.1.8)
      activesupport (= 4.1.8)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.8)
      sprockets-rails (~> 2.0)
    railties (4.1.8)
      actionpack (= 4.1.8)
      activesupport (= 4.1.8)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.3.2)
    rdoc (4.1.2)
      json (~> 1.4)
    responders (1.1.2)
      railties (>= 3.2, < 4.2)
    sass (3.2.19)
    sass-rails (4.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.2)
      sprockets (~> 2.8, < 2.12)
      sprockets-rails (~> 2.0)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    spring (1.1.3)
    sprockets (2.11.3)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.2.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (>= 2.8, < 4.0)
    thor (0.19.1)
    thor-rails (0.0.1)
      rails
      thor
    thread_safe (0.3.4)
    tilt (1.4.1)
    turbolinks (2.5.2)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.5.3)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.6)
    warden (1.2.3)
      rack (>= 1.0)
    webrobots (0.1.1)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 4.0.0)
  devise
  haml
  haml-rails
  jbuilder (~> 2.0)
  jquery-rails
  mechanize
  pg
  rails (>= 4.1.6)
  sass-rails (~> 4.0.3)
  sdoc (~> 0.4.0)
  spring
  thor-rails
  turbolinks
  uglifier (>= 1.3.0)
EN

回答 3

Stack Overflow用户

发布于 2014-12-23 06:11:55

这是spring的一个问题(我知道,wtf?)。基本上,我是这样做的:

代码语言:javascript
复制
$ ps aux | grep spring

wendybeth      32281   0.0  0.2  2490496  16280   ??  S    Fri01PM   0:00.79 spring server | marketing | started 75 hours ago    

$ kill 32281

作为一个整体,我是Rails和开发的新手,我很紧张地说,这个解决方案没有任何副作用。我在这里找到的:

https://jasonplayne.com/web-dev/rails-generate-could-not-find-in-any-of-the-sources

这对我很管用。我不知道为什么-所以除非你自己理解,否则请谨慎使用。:/

票数 3
EN

Stack Overflow用户

发布于 2014-11-18 17:43:54

尝试使用bundle exec rails c,在Gemfile中的gem上下文中运行rails服务器。

票数 1
EN

Stack Overflow用户

发布于 2014-11-18 18:59:58

尝试以下操作:

代码语言:javascript
复制
gem update bundler
bundle install 
rails console
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26990644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档