问题
I am having a problem adding the gem file: gem 'devise'
. When I add it to sublime and then go to the terminal and do bundle install
, I get an error. This is what I get:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
An error occured while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling. (I have no idea what this means)
I am working on the One Month Rails course following the video tutorials.
回答1:
Native Extensions, in short, are a connection between a rubygem and some non-ruby components, usually some C code or library. For further reading on what exactly goes on when building native extensions this blog post by Pat Shaughnessy walks through the process.
To address your question, few things could be causing this problem, but the most likely reason is that you require Command Line Tools installed within OSX. If XCode is already installed, run the below command on the command line to install the tools. If XCode is not installed, install the latest version of XCode, restart your terminal, and then run the below command.
sudo xcode-select --install
Once you've got the command line tools installed you should be good to go.
回答2:
Your ruby development library isn't installed install the ruby 1.9-dev package or similar dev package, and try again else you could use rvm.
来源:https://stackoverflow.com/questions/23551014/trying-to-install-gem-devise