bundle update gives error - ruby

I have got following error on running 'bundle install'
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails-api (>= 0) ruby depends on
railties (>= 3.2.11) ruby
rails (= 3.2.9) ruby depends on
railties (3.2.9)
while update bundle gives also the same error
while gem install railties give following
ERROR: Error installing railties:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
my gem file look like
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem 'sqlite3'
gem 'webapidoc', :github => 'otty/webapidoc'
#gem 'webapidoc', path: '/Users/lion/Work/rails/webapidoc'
gem 'rails-api', :github => 'rails-api/rails-api'
gem 'foreman'
gem 'tire'
gem 'yajl-ruby'
gem 'sync_attr'
gem 'thin'
gem 'capistrano'
gem 'capistrano-unicorn'
gem 'capistrano-ext'
gem 'rvm-capistrano'
gem 'capistrano-detect-migrations'

Related

Sinatra Error: Unable to activate sinatra-contrib-1.4.2

Trying to run a Sinatra app and I keep getting this error:
/Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2064:in `raise_if_conflicts':
Unable to activate sinatra-contrib-1.4.2, because tilt-2.0.1 conflicts with tilt (~> 1.3) (Gem::LoadError)
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems.rb:196:in `rescue in try_activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems.rb:193:in `try_activate'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from app.rb:3:in `<main>'
This is my Gemfile:
gem 'sinatra', '~> 1.4.5'
gem 'activerecord'
gem 'pg'
I tried including
gem 'tilt', '~> 1.3'
in the Gemfile as well but that didn't work.
Any ideas?
I had the same problem. I removed Tilt 2.0.1 and my application works as expected.
Remove gem:
$ gem uninstall tilt -v 2.0.1
Successfully uninstalled tilt-2.0.1
$ bundle install
Resolving dependencies...
...
Bundle complete! 9 Gemfile dependencies, 17 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Restarted application (via Pow):
~/app-dir$ touch tmp/restart.txt
Specifying this in my Gemfile:
gem 'sinatra-contrib', github: 'sinatra/sinatra-contrib'
and running
bundle update
fixed it for me.

Bundler stops at gem json install

I tried to install susy2 /sass / compass with bundler.
My Gemfile:
source "https://rubygems.org"
gem 'sass', '~> 3.3.2'
gem 'susy', '~> 2.1.1'
gem 'json', '~> 1.8.1'
gem 'compass', '~> 1.0.0.alpha.19'
bundle install shows the error
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /home/bernie/.bundler/tmp/6210/gems/json-1.8.1 for inspection.
Results logged to /home/bernie/.bundler/tmp/6210/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
gem list shows:
bundler (1.5.1)
celluloid (0.15.2)
chunky_png (1.3.0)
compass (0.12.4)
compass-core (1.0.0.alpha.19)
compass-import-once (1.0.4)
fssm (0.2.10)
multi_json (1.9.2)
permutation (0.1.8)
rake (10.2.0)
rb-fsevent (0.9.4)
sass (3.3.4, 3.2.18)
susy (2.1.1)
timers (1.1.0)
Any Ideas?
A little bit Googling told me this, have you tried it?
sudo apt-get install ruby1.9.1-dev

can't install gem dm-adapter-simpledb

any idea what should I do? this is error message from bundler
$ bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://rubygems.org/..
Bundler could not find compatible versions for gem "dm-core":
In Gemfile:
dm-adapter-simpledb (>= 0) ruby depends on
dm-core (~> 0.10.0) ruby
dm-core (1.2.0)
here is my Gemfile
source 'http://rubygems.org'
gem 'sinatra'
gem 'json'
gem 'prawn'
gem 'prawn-graph'
gem 'prawn-layout'
gem 'prawn-fast-png'
gem 'prawn-qrcode'
gem 'data_mapper'
gem 'dm-core'
gem 'dm-mysql-adapter'
gem 'dm-postgres-adapter'
gem 'dm-migrations'
gem 'dm-adapter-simpledb'
gem 'aws-sdk', '~> 1.3.4'
gem 'dm-paperclip'
gem 'savon'
gem 'rmagick'
gem 'SystemTimer', :require => "system_timer", :platforms => :ruby_18
gem 'rack-timeout'
gem 'rufus-scheduler'
gem 'mail'
Try to remove dm-core gem from the Gemfile. You don't need it anyway - dm-adapter-simpledb requires it.
If you absolutely must include dm-core gem in the Gemfile, set it to the version required by dm-adapter-simpledb in Gemfile.lock.
dm-adapter-simpledb in your gemfile depends on dm-core version 0.10.0, the one you have is 1.2.0. either remove it as Lukas suggested or update your gemfile: `dm-core', '~> 0.10.0'

Rails - can't run autotest

After my upgrade to Rails 3.1.3 and Ruby 1.9.3 (via RVM) i can't normally run autotest. I don't know what has happened, but when i print:
$ autotest
It shows strange error
loading autotest/rails_rspec2
/Users/serg/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- autotest/fsevent (LoadError)
from /Users/serg/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/serg/rails_projects_terminal/sample_app/.autotest:2:in `<top (required)>'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `load'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `block in initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:314:in `each'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:314:in `initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.8.0/lib/autotest/rspec2.rb:13:in `initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head/gems/rspec-rails-2.8.0/lib/autotest/rails_rspec2.rb:31:in `initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `new'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `run'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/gems/ZenTest-4.6.2/bin/autotest:6:in `<top (required)>'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/bin/autotest:19:in `load'
from /Users/serg/.rvm/gems/ruby-1.9.3-head#global/bin/autotest:19:in `<main>'
But when i try:
bundle exec autotest
It works. How can i fix it?
My gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'gravatar_image_tag'
gem 'will_paginate'
gem 'rack'
gem 'texticle', "2.0", :require => 'texticle/rails'
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end
gem 'jquery-rails'
group :development do
gem 'rspec-rails'
gem 'therubyracer-heroku'
gem 'pg'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
gem 'faker'
end
group :test do
gem 'rspec-rails'
gem 'webrat'
gem 'spork'
gem 'autotest'
gem 'autotest-rails-pure'
gem 'autotest-fsevent'
gem 'autotest-growl'
gem 'factory_girl_rails'
end
group :production do
gem 'pg'
end
I had that issue as well, and to fix it I had to do what you did :
$ gem update ZenTest
$ gem cleanup ZenTest
$ gem install autotest-fsevent
But I also had to add 'autotest-growl' and 'autotest-fsevent' to my gemfile, which now looks like this:
group :development do
gem 'sqlite3'
gem 'rspec-rails'
gem 'autotest'
gem 'ZenTest'
gem 'autotest-growl'
gem 'autotest-fsevent'
end
Then
$ Bundle install
And now
$ autotest
works just fine :)
I solved it. I found this page: http://www.viget.com/extend/how-why-to-run-autotest-on-your-mac/
and then i printed in the Terminal:
$ gem update ZenTest
$ gem cleanup ZenTest
$ gem install autotest-fsevent
After that autotest started to work fine.

Could not find sprockets-2.0.0.beta.10 in any of the sources

I am specifically intertested in #270. You can see it here: http://railscasts.com/episodes/270-authentication-in-rails-3-1
I've downloaded the code, unzipped it and I'm in the auth-before directory.
I run bundle install and I get
Fetching source index for http://rubygems.org/
Could not find sprockets-2.0.0.beta.10 in any of the sources
I've tried fixing it my self and I've gotten this:
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
sprockets (~> 2.0) ruby
sass-rails (~> 3.1.0.rc) ruby depends on
sprockets (2.0.0.beta.10)
My gem file looks like this:
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Asset template engines
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
What should I do to resolve this?
update:
I followed the suggestion below and removed the version number from sass-rails. When I run the update command I get the following:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
sass-rails (>= 0) ruby depends on
railties (~> 3.1.0) ruby
rails (= 3.1.0.rc4) ruby depends on
railties (3.1.0.rc4
Remove the version limitation on sass-rails from your Gemfile, then run
bundle update sprockets sass-rails
Both sass-rails and sprockets have a stable release now.

Resources