0
0
Ruby on Railsframework~20 mins

Rails new project generation - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Rails New Project Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
Correct command to create a new Rails project with PostgreSQL
Which command correctly creates a new Rails project named blog_app using PostgreSQL as the database?
Arails new blog_app --database=postgresql
Brails new blog_app -d mysql
Crails new blog_app --database=mysql
Drails new blog_app --db=postgresql
Attempts:
2 left
💡 Hint
Use the official Rails option to specify the database type.
component_behavior
intermediate
2:00remaining
Effect of --skip-bundle option during Rails project creation
What happens when you run rails new shop_app --skip-bundle?
AThe project is created but gems are not installed automatically.
BThe project creation fails due to missing gems.
CThe project is created and gems are installed automatically.
DThe project is created without generating any files.
Attempts:
2 left
💡 Hint
Think about what 'bundle' means in Rails context.
state_output
advanced
2:00remaining
Number of files generated by default in a new Rails project
After running rails new forum_app with default options, how many files are generated in the project directory (approximately)?
AAbout 50 files
BAbout 100 files
CAbout 200 files
DAbout 500 files
Attempts:
2 left
💡 Hint
Rails generates many configuration, initializers, and default files.
🔧 Debug
advanced
2:00remaining
Error caused by missing Ruby version during Rails new
You run rails new api_app but get an error: Could not find Ruby version 3.1.0. What is the most likely cause?
AThe command syntax is incorrect.
BRails does not support Ruby 3.1.0.
CYou need to update Rails to the latest version.
DRuby 3.1.0 is not installed on your system.
Attempts:
2 left
💡 Hint
Rails requires the Ruby version specified in the Gemfile or default.
🧠 Conceptual
expert
2:00remaining
Understanding the purpose of the Rails 'app' directory after new project generation
What is the main purpose of the app directory created by rails new?
AIt stores configuration files for the Rails environment.
BIt contains the core application code like models, views, and controllers.
CIt holds the database schema and migration files.
DIt contains the Ruby gems and dependencies.
Attempts:
2 left
💡 Hint
Think about where you write your app's main code.