All threads / creating new rails app error
Ask A Question


You’re not receiving notifications from this thread.

creating new rails app error

Yash asked in General

Hi i am creating new app with command rails new myapp then i am getting this error but unable to find how to resolve this i tried installing tzinfo, tzinfo-data and updating bundle but still problems arising at new application creation, server start. How can i resolve this issue. Thanks in advance.

Bundle complete! 15 Gemfile dependencies, 70 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.
run bundle binstubs bundler
rails importmap:install
rails aborted!
TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
C:/Users/nittr/desktop/Ruby/newBlog/config/environment.rb:5:in `'

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
C:/Users/nittr/desktop/Ruby/newBlog/config/environment.rb:5:in `'
Tasks: TOP => app:template => environment
(See full trace by running task with --trace)
rails turbo:install stimulus:install
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.

rails -v and ruby -v? Many issues as the updates to Ruby and Rails require minor fixes.

By removing platforms in gemfile this issue is resolved but now i'm getting new error bootsnap error and my rails and ruby versions are Rails -7.0.1 and ruby -3.1.0 .Thanks for help and using older ruby is recommended for beginner because with this new version i'm facing issues which i'm unable to resolve please suggest best way to start for beginner.

I'm somewhat of a beginner myself. I cycle through various things trying to get new apps working. I'm mostly creating them to use tutorials. But sometime gem install rails or gem update rails, although in principal that shouldn't matter. bundle update while in the app is often a help. Sometimes yarn depending on what else is installed. On my Mac, zsh which relaunches some of the system (that's not accurate description). You'd probably have to go back to Rails 6 and Ruby 2 for consistency , but then you can't play with the new toys of Rails 7 easily.

Yeah thanks for providing help i had older nodejs version so updated it to latest version and i went for installing ruby 3.0.3 and rails 7.0.1 and i didn't got errors while installing and creating new app but after creating new app and starting server now i run this command rails g controller home index to change welcome with /home/index and as per my research this comes when views and controller names are different but in this case names are correct so i'm unable to resolve this issue can you please help me in resolving this. thanks in advance for help.
No template for interactive request
HomeController#index is missing a template for request formats: text/html
Unless told otherwise, Rails expects an action to render a template with the same name,
contained in a folder named after its controller. If this controller is an API responding with 204 (No Content),
which does not require a template, then this error will occur when trying to access it via browser,
since we expect an HTML template to be rendered for such requests. If that's the case, carry on.
My app/views/home/index.html.erb file


Find me in app/views/home/index.html.erb

My controller file
class HomeController < ApplicationController
def index

and routes file
Rails.application.routes.draw do
get 'home/index'

I just updated Ruby and I have a lot of bugs to fix

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,326+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.