ruby/bundler seeming to fail to derive dependencies - ruby

I am getting this error when I run "bundle install"
Could not find gem 'febeling-rubyzip (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
My Gemfile looks like this
source 'http://rubygems.org'
gem 'rails'
gem "authlogic", :git => "git://github.com/binarylogic/authlogic.git"
gem "mechanize"
gem "hpricot"
gem "sqlite3-ruby"
gem "daemons"
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "nokogiri"
gem "roo"
gem "zip"
gem "spreadsheet"
gem "builder"
gem "gimite-google-spreadsheet-ruby"
gem "febeling-rubyzip"
#gem "savon", "=0.7.9"
gem "savon"
#devise is required for rails_admin, but not used
gem 'devise'
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
gem 'febeling-rubyzip'
group :development, :test do
gem "rcov"
gem "capistrano"
end
group :development do
gem "ruby-debug"
gem "httpclient"
end
Any thoughts/tips would be greatly appreciarted.
Thanks, Chris
PS I am using rvm with per project gemsets. Whats probably quite pertinent is that I just did a "rvm gemset empty" and remove Gemfile.lock to do a clean install of the project's gems - things seemed ok prior to that :(

Replace 'febeling-rubyzip' with 'rubyzip'. The new way of naming the gems has changed and it does not have the creator's username (github username) attached to it.

Does gem query -r -n febeling-rubyzip find anything in your version of ruby/gems?

Related

bundle install: 'minitest/autorun x64-mingw32' not in Gemfile

When trying to run bundle install on i receive the following exception:
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Could not find gem 'minitest/autorun x64-mingw32' in any of the gem sources
listed in your Gemfile.
I was originally trying to run bundle exec rake, which suggests the same issue with gem 'minitest/autorun x64-mingw32'. Running them with rake test works fine; hence, I think I've done something wrong with bundler related to my OS (windows 7 x64). The install works properly without this package. I also tried using unit/test with the same result.
Ruby version is 2.4.4.
Gemfile:
source "https://rubygems.org"
gemspec
gem 'json', '~> 2.1.0', '>= 2.0.4'
gem 'addressable', '~> 2.5.2', '>= 2.5.2'
gem 'mongo', '~> 2.5.1', '>= 2.5.1'
group :test do
gem 'rake'
gem 'minitest/autorun'
end
Do I need to specify the platform or some other variable so that bundle looks for the right version of the gem on rubygems?
Any help would be much appreciated.

How to install gems from Gemfile?

I want to add code coverage to my project and sign up coveralls.io and create Gemfile with:
gem 'coveralls', require: false
but how can I install the gem from Gemfile?
run the command bundle install in your shell, once you have your Gemfile created.
This command will look your Gemfile and install the relevant Gems on the indicated versions.
The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
Your can create a Gemfile just by typing bundle init in your shell
I add a Gemfile example for your reference:
source "https://rubygems.org" # where gems will be downloaded from
ruby "2.2.3" # ruby version, change for the one you use
gem "sinatra"
gem "sinatra-flash"
gem "sinatra-partial"
gem "bcrypt"
gem "dm-validations"
gem "dm-transactions"
gem "data_mapper"
gem "dm-postgres-adapter"
gem "pg"
gem "database_cleaner"
group :test do # you can make groups for test, development, production..
gem "rspec"
gem "capybara"
gem "rspec-sinatra"
gem "cucumber"
gem "coveralls", require: false
end
First install bundler if you don't have it
gem install bundler or sudo gem install bundler if you don't have the required permissions. Bundler is a gem that manages gem dependencies.
then you can follow the above instruction for creating the gemfile, after which you can issue the command
bundle install

Why isn't Openshift installing the pg gem that's in my gemfile?

My gemfile for my Ramaze (rack) app looks like this.
source 'http://rubygems.org'
ruby '1.9.3'
gem 'ramaze', "<= 2012.04.14" #old version
gem "innate", ">= 2012.03", "< 2012.11" #old version
gem 'rack', "<= 1.4.1"
gem 'sequel'
#if defined? ENV['RACK_ENV'] == 'production' then gem 'pg' else gem 'sqlite3' end
gem 'pg'
gem "sentry-raven", :git => "https://github.com/coderanger/raven-ruby.git"
gem 'bcrypt-ruby'
gem 'rdiscount'
gem 'redcarpet'
gem 'pony'
gem 'bacon'
gem 'koala'
gem 'stop_forum_spam'
#source 'http://mirror1.prod.rhcloud.com/mirror/ruby/'
#gem 'nokogiri'
#gem 'capybara'
As you can see, the pg gem is defined in it. However when I do a git push on Openshift, it installs every gem on my gem file EXCEPT for pg. I've done bundle install on my computer before a push with a force_clean_build file in the .openshift folder, and it didn't help.
I'm using the Sequel ORM and aren't even using a postgres database in my app, so changing the subject, I've no idea why it wants the pg gem in the first place.
Are you using Windows?
Try looking at this:
https://bugzilla.redhat.com/show_bug.cgi?id=1126343

Confusion on how the bundler's group works

I'm using ruby 1.9.3p194 and bundler 1.1.4
In my Gemfile I have this:
group :production do
gem 'thin', '1.4.1'
end
When I run $ rails s, bundler keeps complains:
Could not find gem 'thin (>= 1.4.1) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I'm running under development environment, so shouldn't it NOT care if it is installed or not? Dose bundler force you to install ALL the gems when running $ rails s?
I also tried the group:test, same thing happens. That doesn't really make sense to me, can anyone help?
my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.6'
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :production do
gem 'thin', '1.4.1'
end
gem 'devise', '2.1.2'
gem 'cancan', '1.6.8'
gem 'will_paginate', '3.0.3'
Possibly the problem is that you are running rails s, while you need to run bundle exec rails s. If you precede a command with bundle exec, it is executed within the context of the bundle. All the gems available to bundler are then available to the command.
By default, gems from bundles are installed in the global gem directory. This can produce confusing results when you don't prepend bundle exec to a command: imagine you have both rails 3.1 and rails 3.2 in your global gems and your Gemfile mentions 3.1. Then you will still call the executable from rails 3.2 when you simply say rails on the command line.
Now of course thin could only be missing if it wasn't installed with the global gems. Assuming you've used the --path option to bundler at least once, your gems have been installed to the path specified there and not to the global repository. After using --path, you must specify bundle exec, otherwise gems simply won't be found at all.

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

I'm getting this error on bundle install
$ bundle install
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /Users/xxx/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/source.rb:162.
Fetching source index for http://rubygems.org/
Could not find sprockets-2.0.0.beta.9 in any of the sources
This is a new codebase I got from a friend and I'm having problems running it on my computer. I have created the same rvm gemset. The Gemfile is as follows:
source 'http://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'rack', :git => 'git://github.com/rack/rack.git'
gem 'rdiscount', :git => 'https://github.com/rtomayko/rdiscount.git'
gem 'stringex'
gem 'mysql'
gem 'mysql2'
gem 'oauth'
gem 'twitter'
gem 'gmail'
group :development, :test do
gem 'rspec', :git => 'https://github.com/rspec/rspec.git'
gem 'rspec-rails', :git => 'https://github.com/rspec/rspec-rails.git'
gem 'rspec-mocks', :git => 'https://github.com/rspec/rspec-mocks.git'
gem 'rspec-core', :git => 'https://github.com/rspec/rspec-core.git'
gem 'rspec-expectations', :git => 'https://github.com/rspec/rspec-expectations.git'
gem 'selenium-webdriver'
gem 'steak', :git => 'https://github.com/cavalle/steak.git'
gem 'factory_girl', :git => 'https://github.com/thoughtbot/factory_girl.git'
gem 'unicorn'
gem 'capistrano'
gem 'database_cleaner'
end
I'm assuming this is downloading the latest Rails version? I believe that may be the problem.
It's not a good idea to point to the master branch of a git repository, especially if you don't commit your Gemfile.lock in the SCM.
I encourage you to replace the :git references to use the gem version.
You can also remove duplicate dependencies. Example, if you include rspec-rails you don't need to list rspec-core and all rspec- libraries. They are already listed in the rspec-rails depedency list. Listing all dependencies and pointing them to the master branch is for sure the cause of several headaches.
Also, why are you using the mysql gem twice?
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'rdiscount'
gem 'stringex'
gem 'mysql'
gem 'mysql2'
gem 'oauth'
gem 'twitter'
gem 'gmail'
group :development, :test do
gem 'rspec-rails', '~> 2.6.0'
gem 'selenium-webdriver'
gem 'steak'
gem 'factory_girl'
gem 'unicorn'
gem 'capistrano'
gem 'database_cleaner'
end

Resources