简体   繁体   中英

block in load_missing_constant': uninitialized constant API::V1::Users (NameError)

Im trying to set up api endpoints for my rails application and keep receiving this error my environment is Ruby 2.6 and Rails 5.2 and im using the 'grape' gem for the api here is the blog I followed to set it up. https://medium.com/@ryanwaldorf/how-to-add-an-api-to-an-existing-rails-app-1d2419ba91bd

here is a link to my repo https://github.com/jslack2537/apiDemoApp

I believe the issue is wither in my config/routes.rb or my application.rb files.

But I could be totally wrong. This is a challenge app and not going to be used in production.

This mainly occurs when naming conventions doesn't match. Try changing api/v1/user.rb to api/v1/users.rb which also the blog suggests. You missed a 's'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM