Bundle Update Unicorn Error - ruby-on-rails

Rails 4.0.1 is available and trying to update to that version (currently on version 4.0)
I'm running bundle update and it starts to work ok but then getting an error that seems to be about Unicorn so the whole thing is aborted. The error is as follows:
Installing unicorn (4.7.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/myname/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
checking for SIZEOF_OFF_T in ruby.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/myname/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/myname/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.
Any idea how I can get round this problem?
GEM FILE
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jquery-ui-rails'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'bcrypt-ruby', '~> 3.0.1'
gem "figaro"
gem 'unicorn'
group :production do
gem 'rails_12factor'
end
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'memcachier'
gem 'dalli'
gem 'devise'

Try running
brew update
I'm not so familiar with unicorn, but when you upgrade to a new operating system, that can sometimes be required to get gems and plugins to work properly.

I have a few ideas.
change your gem file to the following:
gem "unicorn", "~> 4.7.0"
I don't use the ruby gems website often. I usually just look at github, but according to the website, there are some dependancies you don't have.

Having upgraded to Mavericks OS recently (and the new version of XCode) I needed to agree to the Xcode Terms & Conditions before the bundle update would work.
Anyway - all working now.

Related

How to run a Ruby on Rails project (previous version) with new version in Windows

My previous version ruby project is
Ruby - 2.2.0
Rails - 4.2.0
I need to update my project to a new version
Ruby - 2.2.2
Rails - 4.2.1
(currently)
But its showing errors in loading rails
Could you please suggest how to update my previous version to run in new version ?
Note: I am using Windows 8.1 OS
This my error while i run rails -v and ruby bin/rails s
Could not find kgio-2.9.3 in any of the sources
Run `bundle install` to install missing gems.
This my Gem File,
source 'https://rubygems.org'
ruby '2.2.0'
gem 'rails', '4.2.0'
gem 'unicorn-rails'
gem 'unicorn-worker-killer'
gem 'rack-timeout'
gem 'responders', '~> 2.0'
gem 'ar-as-batches', github: 'telent/ar-as-batches', branch: 'master'
gem 'sass-rails', github: 'rails/sass-rails', branch: '4-0-stable'
gem 'coffee-rails'
gem 'compass-rails'
gem 'uglifier'
gem 'angularjs-rails-resource'
gem 'angular-rails-templates'
gem 'ngannotate-rails'
gem 'lodash-rails'
gem 'stripe-rails'
gem 'bcrypt'
gem 'active_model_serializers', github: 'rails-api/active_model_serializers',
branch: '0-8-stable'
gem 'gon'
gem 'acts_as_tenant'
gem 'acts_as_relation', '~> 1.0'
gem 'will_paginate'
gem 'api-pagination'
gem 'activemerchant'
gem 'therubyracer'
gem 'unirest'
group :development do
gem 'spring'
gem 'fontcustom'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'aws-sdk'
end
While running bundle install
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/Ruby/Ruby22/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby/Ruby22/bin/$(RUBY_BASE_NAME)
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
Gem files will remain installed in C:/Ruby/Ruby22/lib/ruby/gems/2.2.0/gems/kgio-
2.9.3 for inspection.
Results logged to C:/Ruby/Ruby22/lib/ruby/gems/2.2.0/gems/kgio-2.9.3/ext/kgio/ge
m_make.out
An error occurred while installing kgio (2.9.3), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.9.3'` succeeds before bundling.

Curb gem broke my Bundle install

I am making contact form in rails app and when tried to bundle install i got error from gem i never added to gemfile. Some mysterious curb gem lack some libraries or something else.
I have looked for answers but can't figure out what they are saying, because of their platforms. I use Cloud9 linux environment with rails 4.2.0
Maybe some of you have ideas how to fix this? bellow is full error message.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150504-13714-unpe0g.rb extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
* extconf.rb failed *
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby
--with-curl-dir
--without-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:18:in <main>': Can't find libcurl or curl/curl.h (RuntimeError)
Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
options to extconf.
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.5#rails4/gems/curb-0.8.8 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.5#rails4/extensions/x86_64-linux/2.1.0/curb-0.8.8/gem_make.out
An error occurred while installing curb (0.8.8), and Bundler cannot continue.
Make sure thatgem install curb -v '0.8.8'` succeeds before bundling.
And here is my gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'sass', '3.4.13'
gem 'sass-rails', '5.0.1'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
gem 'mailgun-rails', '~> 0.1.1'
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
Try removing your Gemfile.lock file located right next to the actual Gemfile and then running bundle install.
If that fails you could try dumping your current gemlist (e.g. imploding rvm) and installing them again.

bundle install gives error could not find email_spec-1.0.0 in any of the sources

I am new to RoR. I have got to open a project that is already created. The folder did not contain bin folder, I copied the contents of bin folder from some other project (which runs and which I have created by following this) to the current. Now when I move to the path/to/bin/ and give rails server, it gives, could not find somegem name in any of the sources. try bundle install.
If I install the gem using gem install gemname -v=versionnumber, it installs properly. But if I give the command bundle install it gives the error
could not find email_spec-1.0.0 in any of the sources
I know copying files is not the correct way to do. But how can I try running the project? or how can we solve this error in particular.
.I also found that the particular version is yanked, I downloaded email_spec 1.0.0 from RubyGems.org from outside. How do I proceed now?
edit::
This is my gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'mysql2'
gem 'haml-rails'
gem 'jquery-rails'
gem 'devise'
gem 'cancan'
gem 'paperclip'
gem 'recurly'
gem 'hoptoad_notifier'
gem 'whenever', :require => false
gem "friendly_id", "~> 3.1"
gem "will_paginate"
gem "fastercsv"
gem 'meta-tags', :require => 'meta_tags'
gem 'acts-as-taggable-on'
gem 'thin'
gem 'faye', '0.5.5'
gem 'rack-ssl', :require => 'rack/ssl'
gem 'localized_country_select'
group :development, :test do
gem 'ruby-debug'
gem 'rspec-rails'
gem 'cucumber'
gem 'cucumber-rails'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy'
gem 'factory_girl_rails'
gem 'hpricot'
gem 'ruby_parser'
gem 'rest-client'
gem 'email_spec'
end
Edit:
As per the comment, I deleted the Gemfile.lock and tried running bundle install again. Now the problem is, it gives the following error
An error occured while installing linecache (0.46) and bundler can not continue. Make sure that gem install linecache -v '0.46' succeeds
I tried giving the command gem install linecache -v=0.46
and it gives some error Gemfiles will remain installed in C:\Ruby193\lib\ruby\gems\1.9.1\gems\linecache-0.46 for inspection.
Results logged to C:\Ruby193\lib\ruby\gems\1.9.1\gems\linecache-0.46\ext\gem_make.out
This particular file has these contents:
C:/Ruby193/bin/ruby.exe extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby193/bin/ruby
what should i do now?
Try removing Gemfile.lock and running bundle install again.

Can't upload to Heroku with SQLite in test group

There is my Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# 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', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use RSpec & FactoryGirl for testing
group :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
end
group :test, :development do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :production do
gem 'pg'
end
# Use annotations for models
gem 'annotate', '>=2.6.0'
# Time and date validations
gem 'validates_timeliness'
# 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]
When I use 'git push heroku development:master' I've got the following error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_b80818e5-941b-4e0a-b519-dfd1f819a11e/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/tmp/build_b80818e5-941b-4e0a-b519-dfd1f819a11e/vendor/ruby-2.0.0/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_b80818e5-941b-4e0a-b519-dfd1f819a11e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /tmp/build_b80818e5-941b-4e0a-b519-dfd1f819a11e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!
! Push rejected, failed to compile Ruby app
How can I fix it? Thanks.
you have got gem validate_timeliness which requires sqlite3. As far as I know you can not use anything other than Postgres on Heroku, so you have to get rid of it somehow*. You can use gem dependency -R to see dependency tree (but only first level) of your gems.
* Not true - see comment below.

Can't push code to heroku

git push heroku master
Using rails (3.2.13)
Installing rdiscount (2.0.7.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for random()... yes
checking for srandom()... yes
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... long
checking size of unsigned int... int
no int with size 4
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
Gem files will remain installed in /tmp/build_cnp5x6n0104p/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2 for inspection.
Results logged to /tmp/build_cnp5x6n0104p/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2/ext/gem_make.out
An error occurred while installing rdiscount (2.0.7.2), and Bundler cannot
continue.
Make sure that `gem install rdiscount -v '2.0.7.2'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
Here is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'bootstrap-sass', '2.1'
gem 'google-webfonts'
gem 'postmarkdown'
gem 'rdiscount', "~> 2.0.7.2"
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.2'
group :test do
gem 'capybara', '1.1.2'
end
group :production do
gem 'pg', '0.12.2'
end
I seemed to start to have problems after I added the postmarkdown gem. I also ran `gem install rdiscount -v '2.0.7.2' in the command line but I'm still receiving this error. Thanks for any help or let me know if you need more info.
you can add ruby "1.9.3" in your gemfile like
source 'https://rubygems.org'
ruby "1.9.3"
and then again bundle install
Try adding ruby version to Gem file
source :rubygems
ruby "1.9.3"
gem 'rails', '3.2.13'
gem 'bootstrap-sass', '2.1'
gem 'google-webfonts'
gem 'postmarkdown'
gem 'rdiscount', "~> 2.0.7.2"
....
ruby 1.9.2 seems to have problem with heroku

Resources