On OS X 10.9.5...
Gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'sass-rails', '5.0.4'
gem 'uglifier', '2.7.2'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.5'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.3.1'
gem 'sdoc', '0.4.1', group: :doc
gem 'mongoid', '4.0.2'
gem 'mongoid-grid_fs', '2.1.0'
gem 'watir-rails', '1.1.0'
group :development, :test do
gem 'byebug', '6.0.2'
gem 'web-console', '2.2.1'
gem 'spring', '1.3.6'
end
Terminal
$ bundle install
...
Installing ffi 1.9.10 with native extensions
...
Bundle complete! 14 Gemfile dependencies, 68 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bundle show ffi
/Users/me/.rvm/gems/ruby-2.2.2/gems/ffi-1.9.10
$ rails c
Could not find ffi-1.9.10 in any of the sources
Run `bundle install` to install missing gems
I tried placing "gem 'ffi', '1.9.10'" in my Gemfile.
I tried removing my Gemfile.lock and repeating this process.
I tried bundle exec rails c.
I tried gem install ffi --version 1.0.11, which seems to be the dependency for childprocess-0.5.6.
None of these attempts make any difference. Any ideas?
I ran into this same error just now, solved with gem pristine --all
Ran into the same issue with
An error occurred while installing ffi (1.10.0), and Bundler cannot
continue.
Make sure that `gem install ffi -v '1.10.0' --source 'https://rubygems.org/'`
succeeds before bundling.
A bundle update followed by a bundle install solved it for me
Related
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.
I'm trying to start up an application in localhost made it with Sinatra and after running bundle install I got the following error:
/home/diego/.rvm/gems/ruby-2.3.1/gems/oj-2.14.6/lib/oj.rb:42:in `require': incompatible library version - /home/diego/.rvm/gems/ruby-2.3.1/gems/oj-2.14.6/lib/oj/oj.so (LoadError)
when I told rackup to start.
I already tried to uninstall the gem and re-install it. I also tried using the last version, but still got the same error.
Here is my Gemfile:
source 'https://rubygems.org'
gem 'rack', '1.6.4'
gem 'sinatra', '1.4.5'
gem 'sinatra-advanced-routes', '0.5.3' ,:require => 'sinatra/advanced_routes'
gem 'rake', '10.5.0'
gem 'activerecord', '4.2.6'
gem 'activesupport', '4.2.6'
gem 'sinatra-activerecord', '2.0.9'
gem 'mysql2', '0.4.3'
gem 'unicorn', '5.0.1'
gem "typhoeus", '1.0.1'
gem 'i18n', '0.7.0'
gem 'newrelic_rpm', '3.15.0.314'
gem 'oj', '2.14.6'
gem 'oj_mimic_json', '1.0.1'
gem 'active_model_serializers', '0.9.5'
gem 'sinatra-respond_to', '0.9.0'
gem 'shotgun', '~> 0.9.1'
Finally I changed my ruby version to ruby 2.3.3 and works.
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
I typed rails s to run my server then I got this:
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
Could not find gem 'pg' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
So I did bundle install then I got this:
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
I did brew install postgres to solve this but it still didn't work. Also I put 'gem pg '0.18.4' on Gemfile then did bundle install but still didn't work.
I need your help!
below is my Gemfile
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: :production
#gem 'pg', '0.18.4'
gem 'rails_12factor', group: :production
# 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
Have you tried to clean and rebuild you gem bundle? You can do it with command bundle clean --force and then bundle install again.
Please be advised: the clean command will remove all your gems.
Post back the result of such commands if you decide to run them.
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.