Skip to main content

Ruby Gems — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Ruby Gems — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

What are Ruby Gems?

Question 2 of 40
★ FPSC ★ PPSC

How do you install a Ruby Gem?

Question 3 of 40
★ FPSC ★ PPSC

Which command is used to list all installed gems in Ruby?

Question 4 of 40
★ FPSC ★ PPSC

What is Bundler in the context of Ruby Gems?

Question 5 of 40
★ FPSC ★ PPSC

What does the command gem uninstall gem_name do in Ruby?

Question 6 of 40
★ FPSC ★ PPSC

What is the purpose of the Gemfile in Ruby projects?

Question 7 of 40
★ FPSC ★ PPSC

Which command is used to update all installed gems to their latest versions in Ruby?

Question 8 of 40
★ FPSC ★ PPSC

What is the purpose of the gemfile.lock file in Ruby projects?

Question 9 of 40
★ FPSC ★ PPSC

What does the command gem search keyword do in Ruby?

Question 10 of 40
★ FPSC ★ PPSC

Which command is used to build a Ruby gem from a gemspec file?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the gemspec file in a Ruby gem?

Question 12 of 40
★ FPSC ★ PPSC

What is the purpose of the gem environment command in Ruby?

Question 13 of 40
★ FPSC ★ PPSC

How do you create a new Ruby gem?

Question 14 of 40
★ FPSC ★ PPSC

What does the command gem pristine gem_name do in Ruby?

Question 15 of 40
★ FPSC ★ PPSC

What is the purpose of the --no-ri and --no-rdoc flags when installing gems?

Question 16 of 40
★ FPSC ★ PPSC

What is the purpose of the gem update --system command in Ruby?

Question 17 of 40
★ FPSC ★ PPSC

How do you specify a specific version of a gem to be installed in a Gemfile?

Question 18 of 40
★ FPSC ★ PPSC

Which command is used to uninstall all gems except default gems in Ruby?

Question 19 of 40
★ FPSC ★ PPSC

What does the --remote flag do in the context of the gem list command in Ruby?

Question 20 of 40
★ FPSC ★ PPSC

What is the purpose of the gem owner gem_name command in Ruby?

Question 21 of 40
★ FPSC ★ PPSC

Which command is used to view information about a specific gem in Ruby?

Question 22 of 40
★ FPSC ★ PPSC

What is the purpose of the --version flag when installing a gem using the gem install command in Ruby?

Question 23 of 40
★ FPSC ★ PPSC

What is the purpose of the --development flag when installing gems using Bundler?

Question 24 of 40
★ FPSC ★ PPSC

What is the purpose of the bundle install --without production command in Ruby projects?

Question 25 of 40
★ FPSC ★ PPSC

What does the gem yank gem_name --version version_number command do in Ruby?

Question 26 of 40
★ FPSC ★ PPSC

What is the purpose of the gem outdated command in Ruby?

Question 27 of 40
★ FPSC ★ PPSC

What does the gem pristine --all command do in Ruby?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of the --development flag when updating gems using Bundler?

Question 29 of 40
★ FPSC ★ PPSC

What does the gem list --local command do in Ruby?

Question 30 of 40
★ FPSC ★ PPSC

What is the purpose of the bundle exec command in Ruby projects?

Question 31 of 40
★ FPSC ★ PPSC

What does the gem fetch gem_name command do in Ruby?

Question 32 of 40
★ FPSC ★ PPSC

Which command is used to check the details of a specific gem version in Ruby?

Question 33 of 40
★ FPSC ★ PPSC

What is the purpose of the gem dependency gem_name command in Ruby?

Question 34 of 40
★ FPSC ★ PPSC

What does the gem uninstall gem_name -v version_number command do in Ruby?

Question 35 of 40
★ FPSC ★ PPSC

Which command is used to open the documentation for a specific gem in Ruby?

Question 36 of 40
★ FPSC ★ PPSC

What is the purpose of the --no-document flag when installing gems using Bundler?

Question 37 of 40
★ FPSC ★ PPSC

What does the gem install gemfile command do in Ruby?

Question 38 of 40
★ FPSC ★ PPSC

Which command is used to list outdated gems and their dependencies in Ruby?

Question 39 of 40
★ FPSC ★ PPSC

What is the purpose of the gem install gem_name -N command in Ruby?

Question 40 of 40
★ FPSC ★ PPSC

What is the purpose of the gem environment gemdir command in Ruby?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →