rails api with mongodb raising exception for rails g command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

rails api with mongodb raising exception for rails g command

Sukhbir Singh

I am developing a rails-api application using mongodb as database. The problem is each time i try rails generators, 


It raises an exception in terminal :--

/user/.gem/ruby/gems/railties-5.1.3/lib/rails/application/configuration.rb:139:in database_configuration': Cannot loadRails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"] (RuntimeError)


Since, i am using mongodb it does not requires database.yml file.


Expected behavior

It should execute rails g scaffold article2 name:string content:text command without any error.


Actual behavior

Right now it is raising the exception

/user/.gem/ruby/gems/railties-5.1.3/lib/rails/application/configuration.rb:139:in database_configuration': Cannot loadRails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"] (RuntimeError)


System configuration

Rails version: 5.1.3

Ruby version: 2.4.1


And hence, i want to ask how to solve this problem!!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/47b4ad0b-7b95-47d5-aa99-97a1b666db3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...