An error occurred while installing eventmachine (1.0.3) [duplicate] - ruby-on-rails

This question already has answers here:
gem eventmachine fatal error: 'openssl/ssl.h' file not found
(15 answers)
Closed 7 years ago.
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?

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.

Related

Solidus Installation Failure

So Solidus is a fork of Spree and Spree is no longer maintained.
Am following the instructions on the Solidus's Github page (https://github.com/solidusio/solidus) to install it. And am stuck at this command bundle exec rails g spree:install this command raises the following error:
/Users/user1/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/handlebars_assets-0.19.1/lib/handlebars_assets.rb:20:in 'block in register_extensions': undefined method 'register_engine' for nil:NilClass (NoMethodError)
Not sure if this might help but before trying to install Solidus I was working on a Spree project.
Also, here is my Gemfile:
source 'https://rubygems.org'
# Solidus E-Commerce
gem 'solidus'
gem 'solidus_auth_devise'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
Any help is really appreciated.
Update:
This is a known bug with handlebars-assets gem, which is resolved in master.
Adding the line :
gem 'handlebars_assets', github: 'leshill/handlebars_assets'
to your Gemfile will solve your problem until a new version contains the relevant fix.
Move the lines :
gem 'solidus'
gem 'solidus_auth_devise'
below gem 'rails', '4.2.4' because the former depends on the latter.
We've released a new version of solidus (v1.1.1) which locks sprockets-rails to 2.x to fix this issue.
https://github.com/solidusio/solidus/releases/tag/v1.1.1
In lieu of upgrading you can also specify the older sprockets-rails version in your Gemfile
gem "sprockets-rails", "~> 2.3"

Cannot run a migration update in Ruby

Im using ruby and I go to do a rake db:migrate which I get the follow error:
LoadError: cannot load such file -- bundler/setup
C:/Sites/raddit/config/boot.rb:4:in <top (required)>'
C:/Sites/raddit/config/application.rb:1:in'
C:/Sites/raddit/Rakefile:4:in `
Then I run bundle exec rake db:migrate and get this error
You have requested:
sqlite3 >= 0
The bundle currently has sqlite3 locked at 1.3.11.
Try running bundle update sqlite3
I update sqlite 3 as it says and Ive deleted my gemfile but yet nothing works
Here is my Gemfile
source 'https://rubygems.org'
gem 'devise', '~> 3.5', '>= 3.5.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3', '>= 1.3.11'
# 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
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
To fix the problem I just re installed bundler to do this just do gem install bundler and then ran bundle install. It will re install all the past gems and should fix the problem.

How to resolve "ERROR: Failed to build gem native extension."

Hello please help me to resolve this error.I wanted to design a chat application using private_pub gem.i add the code gem private_pub in my gem file.when i run the command bundle in command prompt it gave the following error.
Errors:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe -r ./siteconf20141218-3932-nyliv2.rb extconf.rb
creating Makefile
make clean
Makefile:165: *** target pattern contains no `%'. Stop.
make
Makefile:165: *** target pattern contains no `%'. Stop.
make failed, exit code 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/http_pars
er.rb-0.6.0 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/ht
tp_parser.rb-0.6.0/gem_make.out
An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot
continue.
Make sure that `gem install http_parser.rb -v '0.6.0'` succeeds before bundling.
I already have all installation before my system.I am using ruby-1.9.3, rails-4 and i already installed the proper devkit for ruby 1.9.3.Please provide me the step by step process to solve the above error.
Here is my gemfile.
# 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
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'private_pub'
as Show in Error Report You Need To insatll "gem http_parser.rb (0.6.0)" before installing gem private_pub.
to install http_parser.rb (0.6.0),
add gem 'http_parser.rb', '~> 0.6.0' in your gem file.then run the command bundle.

Ruby Gemfile can not add the PostgreSQL gem

Here's my Gemfile:
source 'https://rubygems.org'
#my added gems
gem 'pg', '~> 0.17.1'
gem 'rails_12factor', '0.0.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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
You can see on the 4th line that I add the line for the pg gem. After saving and running bundle install in my terminal I get the following error with this error:
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
Anyone know how to get around this?
Did you try before bundle install what the message says?
gem install pg -v '0.17.1'
Also, If you are running this locally and you need postrgre just to deploy the app to a server like Heroku(you are using sqlite/mysql locally) add it to the production enviroment like this:
group :production do
gem 'pg'
end
and run
bundle install
again.

Why won't my Gemfile run?

I am following the Hartl Ruby on Rails tutorial, and am in section 1.2.4 of the tutorial
When setting up a Rails app it says to run these commands:
cd first_app_direcory
sublime Gemfile
bundle update
The sublime Gemfile command edits the Gemfile obviously, but when I try to run the command bundle update I get the following error:
bundle update
Gemfile syntax error:
ruby 2.0.0
^
/home/cameron/ruby/ror/first_app/Gemfile:2:
syntax error, unexpected tINTEGER,
expecting '('
ruby 2.0.0
^
I took these two lines out of the gemfile, even though it says to include them. Also, I tried Ruby 1.9.3, and still got the same error message.
ruby 2.0.0
#ruby-gemset=railstutorial_rails_4_0
After taking these lines out, it worked. I am trying to get it to work with those lines in the gemfile though. How can I do this?
This is the full Gemfile:
source 'https://rubygems.org'
ruby 2.0.0
#ruby-gemset=railstutorial_rails_4_0
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
group :developent do
gem 'sqlite3', '1.3.7'
end
# Use SCSS for stylesheets
gem 'sass-rails', '4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'
# 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', '2.2.1'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '0.3.20',require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
You should have
ruby '2.0.0'
instead of
ruby 2.0.0
in your Gemfile.
I think you need quotes around the 2.0.0.
Something like ruby "2.0.0".

Resources