Why do I get a bcrypt-ruby gem install error?

后端 未结 10 463
面向向阳花
面向向阳花 2020-12-06 09:07

Getting an error when trying to install the gem devise, the installation is stopping on the gem bcrypt-ruby:

$ gem install bcrypt-ruby
Error installing bcry         


        
相关标签:
10条回答
  • 2020-12-06 09:29

    It requires to install ruby-dev before installing bcrypt-ruby. If you are using Ubuntu, run

    sudo apt-get install ruby1.9.1-dev
    

    or

    sudo apt-get install ruby1.8-dev
    

    based on RUby version.

    0 讨论(0)
  • 2020-12-06 09:30

    If you are using version 1.8 the required packages for bcrypt are in the dev bundle. Try using

    $sudo apt-get install ruby1.8-dev
    

    then

    $gem install bcrypt-ruby 
    
    0 讨论(0)
  • 2020-12-06 09:31

    Looks like there might be some info missing here - for me, this was due to a brew install of gcc. gcc was in /usr/bin, but not gcc-4.2. So I just did the following:

    $ cd /usr/bin
    $ sudo ln -s gcc gcc-4.2
    

    which creates a link, gcc-4.2, which the gem is looking for that goes back to gcc.

    Hope that helps.

    0 讨论(0)
  • 2020-12-06 09:33

    sudo apt-get install ruby1.9.1-dev

    whoked charm for me! Thanks a lot

    0 讨论(0)
  • 2020-12-06 09:35

    This fix work for me on ubuntu on osx use homebrew, macports whatever:

    sudo apt-get install ruby1.9.1-dev
    
    0 讨论(0)
  • 2020-12-06 09:39

    Well, it works with Ruby 1.9.2 under RVM on MacOS 10.6.7:

    $ ruby -v
    ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
    
    $ gem install bcrypt-ruby
    Fetching: bcrypt-ruby-2.1.4.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed bcrypt-ruby-2.1.4
    1 gem installed
    Installing ri documentation for bcrypt-ruby-2.1.4...
    Installing RDoc documentation for bcrypt-ruby-2.1.4...
    

    Try rvm notes and see if it says you need to install anything.

    0 讨论(0)
提交回复
热议问题