How to install gemstones from gemfile?

I want to add code coverage to my project and register coveralls.io and create a gemfile using

gem 'coveralls', require: false

but how can i install gem from gemfile?

+4
source share
2 answers

run the command bundle installin your shell once you have created your gemfile.

This command will search for your Gemfile and install the appropriate Gems in the specified versions.

Gemfiles are installed because in your Gemfile you specify the source from which to download gems.

You can create a gemfile by simply typing bundle initin your shell

I am adding 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
+12
source

, .

gem install bundler sudo gem install bundler, . Bundler - , .

gemfile,

bundle install

+4

All Articles