Ruby on rails 安装bcrypt后,无法立即找到它

Ruby on rails 安装bcrypt后,无法立即找到它,ruby-on-rails,ruby,ruby-on-rails-4,devise,bcrypt,Ruby On Rails,Ruby,Ruby On Rails 4,Devise,Bcrypt,在Rails 4.1项目中,我刚刚添加了Desive and run bundle安装。在此之后,由于缺少bcrypt,因此没有任何命令起作用: $ 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 t

在Rails 4.1项目中,我刚刚添加了Desive and run bundle安装。在此之后,由于缺少bcrypt,因此没有任何命令起作用:

$ 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.
尽管很明显它已安装:

$ 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
我的文件如下所示:

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)
来源

我的Gemfile.lock如下所示:

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)
尝试bundle exec rails c,在Gem文件中的Gem上下文中运行rails服务器。

尝试bundle exec rails c,在Gem文件中的Gem上下文中运行rails服务器。

尝试以下操作:

gem update bundler
bundle install 
rails console
请尝试以下操作:

gem update bundler
bundle install 
rails console

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

$ 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&development是新手,我很紧张地说,这个解决方案没有任何副作用。我在这里找到的:


这对我有用。我不知道为什么——所以除非你自己理解,否则小心使用/

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

$ 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&development是新手,我很紧张地说,这个解决方案没有任何副作用。我在这里找到的:


这对我有用。我不知道为什么——所以除非你自己理解,否则小心使用/

您找到解决方案了吗?您找到解决方案了吗?您也可以使用spring stop而不是手动终止进程。您也可以使用spring stop而不是手动终止进程。