0
0
Ruby on Railsframework~10 mins

Gemfile and dependency management in Ruby on Rails - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify a gem dependency in the Gemfile.

Ruby on Rails
gem '[1]'
Drag options to blanks, or click blank then click option'
Arails
Bbundle
Cruby
Dgemfile
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bundle' or 'gemfile' which are not gem names.
Confusing the gem name with Ruby language.
2fill in blank
medium

Complete the code to specify a gem with a version constraint in the Gemfile.

Ruby on Rails
gem 'nokogiri', '[1] 1.13.3'
Drag options to blanks, or click blank then click option'
A<=
B>=
C~>
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' which locks to exact version.
Using '>=' which allows any newer version.
3fill in blank
hard

Fix the error in the Gemfile line to specify a group for development gems.

Ruby on Rails
group :[1] do
  gem 'pry'
end
Drag options to blanks, or click blank then click option'
Adevelopment
Btest
Cproduction
Dstaging
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'test' group for development-only gems.
Using 'production' which is for live environment.
4fill in blank
hard

Fill both blanks to specify a gem with a platform restriction and a version in the Gemfile.

Ruby on Rails
gem 'sqlite3', platform: :[1], '[2] 1.4.2'
Drag options to blanks, or click blank then click option'
Aruby
B~>
C>=
Dwindows
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ruby' as platform when restricting to Windows.
Using '>=' which allows too broad versions.
5fill in blank
hard

Fill all three blanks to create a group block for test and development gems with a version constraint.

Ruby on Rails
group :[1], :[2] do
  gem 'rspec-rails', '[3] 5.0.0'
end
Drag options to blanks, or click blank then click option'
Atest
Bdevelopment
C~>
Dproduction
Attempts:
3 left
💡 Hint
Common Mistakes
Including 'production' in the group for test gems.
Using '==' instead of '~>' for version.