Bird
0
0

You want to use a specific version 2.1.0 of the 'httparty' gem in your project. How do you specify this version in your Gemfile?

hard📝 Application Q8 of 15
Ruby - Gems and Bundler
You want to use a specific version 2.1.0 of the 'httparty' gem in your project. How do you specify this version in your Gemfile?
Agem 'httparty', version: '2.1.0'
Bgem 'httparty' version '2.1.0'
Cgem 'httparty', '2.1.0'
Dgem 'httparty' => '2.1.0'
Step-by-Step Solution
Solution:
  1. Step 1: Recall Gemfile version syntax

    To specify a gem version, use gem 'name', 'version'.
  2. Step 2: Identify correct syntax

    Only gem 'httparty', '2.1.0' uses the correct syntax; others are invalid Ruby syntax.
  3. Final Answer:

    gem 'httparty', '2.1.0' -> Option C
  4. Quick Check:

    Gemfile version syntax = gem 'name', 'version' [OK]
Quick Trick: Specify gem version as second string argument in Gemfile [OK]
Common Mistakes:
  • Using hash syntax incorrectly
  • Omitting commas between arguments
  • Using invalid Ruby syntax for version

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes