[英]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.我正在尝试为我的 rails 应用程序设置 api 端点,并不断收到此错误我的环境是 Ruby 2.6 和 Rails 5.2,我在此处使用 'grape' gem 作为 api 是我遵循的博客来设置它。 https://medium.com/@ryanwaldorf/how-to-add-an-api-to-an-existing-rails-app-1d2419ba91bd
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这是我的仓库https://github.com/jslack2537/apiDemoApp的链接
I believe the issue is wither in my config/routes.rb or my application.rb files.我相信问题出在我的 config/routes.rb 或我的 application.rb 文件中。
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.尝试将
api/v1/user.rb
更改为api/v1/users.rb
这也是博客建议的。 You missed a 's'.你错过了一个's'。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.