# Deploy failed when add new gem to Gemfile

**URL:** <https://www.ruby-forum.com/t/deploy-failed-when-add-new-gem-to-gemfile/226804>\
**Category:** Rails\
**Created:** [February 21, 2013, 5:31pm UTC](https://www.ruby-forum.com/t/deploy-failed-when-add-new-gem-to-gemfile/226804 "2013-02-21T17:31:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aisensiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@aisensiy](https://www.ruby-forum.com/u/aisensiy)\
**Post date:** [February 21, 2013, 5:31pm UTC](https://www.ruby-forum.com/t/deploy-failed-when-add-new-gem-to-gemfile/226804/1 "2013-02-21T17:31:22Z")

</div>

I learnt how to deploy rails project to VPS from railscasts \*#335  
Deploying  
to a VPS. \*But I get a problem when add a new gem to Gemfile.

For this time, i add devise to Gemfile. and after `git push` I run  
commend  
`cap deploy`. Then it show message like this:

\*\* [out :: ali] Gem::Installer::ExtensionBuildError: ERROR: Failed to  
build gem native extension.  
\*\* [out :: ali]  
\*\* [out :: ali]  
\*\* [out :: ali] /usr/bin/ruby1.9.1 extconf.rb  
\*\* [out :: ali]  
\*\* [out :: ali]  
\*\* [out :: ali] Gem files will remain installed in  
/home/deployer/apps/get-real/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1  
for inspection.  
\*\* [out :: ali]  
\*\* [out :: ali] Results logged to  
/home/deployer/apps/get-real/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri/gem\_make.out  
\*\* [out :: ali]  
\*\* [out :: ali] An error occurred while installing bcrypt-ruby (3.0.1),  
and Bundler cannot continue.  
\*\* [out :: ali]  
\*\* [out :: ali] Make sure that `gem install bcrypt-ruby -v '3.0.1'`  
succeeds before bundling.

I have spent a lot of time on this but i can not solve it.

---

<div class="post-metadata">

**Author:** ![aisensiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@aisensiy](https://www.ruby-forum.com/u/aisensiy)\
**Post date:** [February 21, 2013, 5:36pm UTC](https://www.ruby-forum.com/t/deploy-failed-when-add-new-gem-to-gemfile/226804/2 "2013-02-21T17:36:03Z")

</div>

On Thursday, February 21, 2013 2:52:32 PM UTC, aisensiy wrote:

> I learnt how to deploy rails project to VPS from railscasts \*#335  
> Deploying to a VPS. \*But I get a problem when add a new gem to Gemfile.
> 
> For this time, i add devise to Gemfile. and after `git push` I run commend  
> `cap deploy`. Then it show message like this:

As the message suggests it’s having trouble building the native  
extension  
for bcrypt-ruby. You’ll get a better error message by looking  
at  
/home/deployer/apps/get-real/shared/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri/gem\_make.out  
but the underlying is probably 1 (or more) of the following:

- you don’t have a compiler/toolchain installed (gcc and so on)
- you don’t have the headers for ruby itself installed (sometimes  
package  
managers install this separately as ruby-devel or similar)
- you don’t have a library (or the headers for that library) that  
bcrypt-ruby depends on (I don’t know if there are any)

The output from the build attempt should clarify which of these apply

Fred
