Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred while installing eventmachine (1.0.3) [duplicate]

I have Rails 4.2.5 and ruby 2.0.0 installed.

This is a Gemfile of a project :

source 'https://rubygems.org'

gem "whenever"

gem "therubyracer"
gem "less-rails"
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

gem 'geokit'

gem 'sequenced'

gem 'acts-as-taggable-on'

gem 'bcrypt', :require => 'bcrypt'

gem 'rack-cors', :require => 'rack/cors'

# Paperclip
gem "paperclip", "~> 4.2"

gem "thin"

gem "passenger"

gem 'geocoder'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

When I make bundle install I receive the following error : "An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue. Make sure that gem install eventmachine -v '1.0.3' succeeds before bundling."

And if I make gem install eventmachine I have the following error

make "DESTDIR=" compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^
1 error generated.
make: *** [binder.o] Error 1
Gem files will remain installed in        /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.8 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.8/ext/gem_make.out

How Can I fix it?

like image 982
Ignacio Chiazzo Avatar asked Dec 30 '15 23:12

Ignacio Chiazzo


1 Answers

I had this problem before and running the command below worked

gem install eventmachine -v '1.0.3'  -- --with-cppflags=-I/usr/local/opt/openssl/include

I can't remember where I found it or the reason why this work. Maybe someone else can complement the answer.

like image 97
Cassio Cabral Avatar answered Sep 28 '22 06:09

Cassio Cabral