简体   繁体   English

在开发模式下与Rails App PostgreSQL数据库进行交互

[英]Interacting with Rails App PostgreSQL Database in Dev Mode

I have what I hope is a fairly simple question: 我希望有一个相当简单的问题:

I've recently taken over as webmaster for a small company, and I'm admittedly new to a lot of this stuff. 我最近刚接任一家小公司的网站管理员,但我对许多此类工作还是陌生的。 Basically, I've set up a local version of the company's web app for development, and everything in the app works as expected until I try to navigate to product pages, at which point I'm met with a 'Page Not Found' error. 基本上,我已经设置了要开发的公司Web应用程序的本地版本,并且该应用程序中的所有内容均按预期工作,直到尝试导航到产品页面为止,此时遇到“找不到页面”错误。 I'm guessing I haven't configured something related to the DB correctly, but I'm not sure what. 我猜我没有正确配置与数据库有关的内容,但是我不确定是什么。 As I said, I'm pretty new to all this stuff. 就像我说的那样,我对所有这些东西都很陌生。

We're currently using Ruby 1.9.3, PostgreSQL 9.1.3, and Spree storefront 1.1.1. 我们目前正在使用Ruby 1.9.3,PostgreSQL 9.1.3和Spree店面1.1.1。

Thanks. 谢谢。

EDIT: 编辑:

When I try to log into the admin panel I'm told that I'm using an invalid email/password. 当我尝试登录到管理面板时,被告知我使用的电子邮件/密码无效。 The development.log file records the following when attempting to access product pages: 尝试访问产品页面时,development.log文件记录以下内容:

Started GET "/t/category/bedding" for 127.0.0.1 at 2014-02-22 23:31:35 -0800
Processing by Spree::TaxonsController#show as HTML
Parameters: {"id"=>"category/bedding"}
[1m[35mSpree::Taxon Load (1.6ms)[0m  SELECT "spree_taxons".* FROM "spree_taxons" 
WHERE      "spree_taxons"."permalink" = 'category/bedding' LIMIT 1
Rendered public/404.html (0.4ms)
Completed 404 Not Found in 13ms (Views: 5.0ms | ActiveRecord: 3.4ms)

Spree displays "page not found" if ActiveRecord::RecordNotFound is raised, so yes, you might be right. 如果引发ActiveRecord :: RecordNotFound,则Spree将显示“找不到页面”,因此,可能是正确的。 But if there was some major issue with DB configuration, your would not be able to do anyting with app, it would crash immediately. 但是,如果数据库配置存在一些重大问题,则您将无法对应用程序进行任何操作,它将立即崩溃。

Can you see any products in admin section? 您可以在管理部分看到任何产品吗? Where did you get initial DB data? 您是从哪里获得初始数据库数据的? Try inspecting log/development.log file (I'd recommend to clear it before visiting products page to get rid of everything else). 尝试检查log / development.log文件(我建议您在访问产品页面之前清除它,以摆脱其他一切)。 There might be some query that fails and results in "page not found" 可能有一些查询失败,并导致“找不到页面”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails应用程序和sqlite(dev)与Postgresql(产品) - Rails app and sqlite (dev) vs postgresql (prod) 启动Rails应用程序的PostgreSQL数据库 - Starting PostgreSQL database for Rails app 带有PostgreSQL数据库的Rails应用程序中的列名错误 - Wrong name of the column in Rails app with PostgreSQL database 与数据库表交互时 rails 控制台出错 - Error in rails console when interacting with database tables Rails 服务器在开发模式下工作,但不在生产模式下 - Rails server works in dev mode but not in production mode PostgreSQL数据库和Rails 3应用程序中的列不存在错误 - Column does not exist error in PostgreSQL database and Rails 3 app 无法在开发模式下在Rails应用上加载资产:ERR_CONNECTION_REFUSED - Cannot load assets in dev mode on rails app : ERR_CONNECTION_REFUSED PostgreSQL数据库不再在我的Ruby On Rails应用程序中工作 - PostgreSQL database no longer working in my Ruby On Rails app 通过URL将Docker容器中的rails应用程序连接到外部Postgresql数据库 - Connect rails app in Docker container to external Postgresql Database via URL 如何将Ruby on Rails应用程序的本地PostgreSQL数据库部署到heroku? - How to deploy a local postgresql database of Ruby on rails app to heroku?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM