Comments (21)
Hello there,
I don't think it is an issue with your postgres user. It seems you have successfully created the database and run the migrations so your postgres connection details are probably okay.
First of all I'd suggest you check from the console that the migrations have run successfully. To get to the console run:
rails c
From the console run this command and let me know the result:
Pwb::User.count
from property_web_builder.
jasonl@wyo-jol-uws01:~/jason$ rails c
Running via Spring preloader in process 1799
Loading development environment (Rails 5.1.4)
irb(main):001:0> Pwb::User.count
(0.8ms) SELECT COUNT(*) FROM "pwb_users"
=> 2
irb(main):002:0>
--
I didn't even know how to access the rails console until now..
from property_web_builder.
Okay, so you really have got the db setup right. Just to be sure there isn't some corrupt data in the db or something along those lines please run the ff to destroy and recreate the database:
rails db:drop db:create db:migrate
After that try seeding the db again:
rails pwb:db:seed
If you get the same error again we might have to do some debugging with:
https://github.com/deivid-rodriguez/pry-byebug
We could arrange a skype call and I can talk you through the process.
from property_web_builder.
Well, the same error occurred: (not the full trace this time)
rails pwb:db:seed
rails aborted!
ActiveRecord::RecordInvalid: Validation failed: User must exist
/home/jasonl/jason/bin/rails:9:in require' /home/jasonl/jason/bin/rails:9:in
<top (required)>'
/home/jasonl/jason/bin/spring:15:in <top (required)>' bin/rails:3:in
load'
bin/rails:3:in `
Tasks: TOP => pwb:db:seed
(See full trace by running task with --trace)
I'll do some reading on the debugging tool but it looks pretty simple to install. A skype call might be a bit of a challenge, I'd like to work with your availability since I'm on UTC -7. About to leave for work soon but I will keep up with this topic throughout the day, or I can email you at the address in your profile.
from property_web_builder.
Very strange. Can you go to the console again and try running this to see if it works:
Pwb::Contact.create(primary_email: "[email protected]")
from property_web_builder.
The contacts model is actually not crucial for the website right now so you could comment out the line for seeding it as a workaround.
Just open up this file in your text editor and comment out line 58:
/home/jasonl/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/bundler/gems/property_web_builder-b86b43186d0e/lib/pwb/seeder.rb
from property_web_builder.
The contact creation appears to have worked. Ill comment the part you said out when I'm not working from a mobile phone.
https://gist.github.com/acmeraptor/ef9a0d2a4077322123db417f5198bf01
from property_web_builder.
Ok, I commented out the following line:
. def seed_contacts yml_file
. contacts_yml = load_seed_yml yml_file
. contacts_yml.each do |contact_yml|
. unless Pwb::Contact.where(primary_email: contact_yml['email']).count > 0
. # Pwb::Contact.create!(contact_yml)
. end
^^the periods were added so it was a little more readable for this site
Re-ran rails db:drop db:create db:migrate
Re-ran rails pwb:db:seed
Which now produces the following full trace, https://gist.github.com/acmeraptor/528b2016f3fc49cc6ae76ff458138327
from property_web_builder.
Okay, I've just done some more research into this. It seems to be to do with not declaring a couple of belongs_to relationships as optional:
https://stackoverflow.com/questions/38983666/validation-failed-class-must-exist
I have just now pushed out a fix. To update to the latest version, run this command:
bundle update pwb
Let me know if that works.
from property_web_builder.
Now I have this: https://gist.github.com/acmeraptor/6929b2373271dc34c8581107cd46405a
from property_web_builder.
I am not depending on these versions of ruby or rails, if there is a working set of prerequisites then I can easily switch to them. My test server is just a virtual machine running on my laptop that I am using before I put anything on what I consider a production server. I am only running the versions of things now because they were recommended by a different guide.
from property_web_builder.
I kind of take my last statement back. Despite the error, I now have a working test site. I think you can mark this problem as resolved. I have some other issues but I think they're not related to the one I originally posted about.
from property_web_builder.
hi @etewiah! I am stuck with the same error. I got rvm with ruby-2.3.4
and Rails 5.1.4
. I am getting this error after I comment out the seed_contacts yml_file
method above:
rails aborted!
ActiveRecord::RecordInvalid: Validation failed: Page must exist
Do you think you can help me out here? Im on Skype via dancallao
from property_web_builder.
Hi @dcallao, can you please try with the latest master branch of PropertyWebBuilder and let me know how that goes?
If you have the latest version you will see this in your Gemfile.lock:
remote: https://github.com/etewiah/property_web_builder
revision: 96a24e9
If you do get the error again, please copy it in full like acmeraptor did - it helps me troubleshoot.
In case that does not work we can certainly speak via Skype.
from property_web_builder.
Good to hear @acmeraptor - any other problems just go ahead and open another issue and I'll help you resolve it.
from property_web_builder.
I'll keep up with this thread since someone else is having the same issue. The latest gist: https://gist.github.com/acmeraptor/27e549a6713e09405106e4e3a84e9e81
from property_web_builder.
Sorry guys, I missed out on adding the "optional: true" statement in the belongs_to page relationship for the link model.
Just added that now.
Run "bundle update pwb" once more to update to the latest and try running the seed task again.
from property_web_builder.
I'd say you've nailed it. rails pwb:db:seed & rails pwb:db:seed_pages completed without errors.
https://gist.github.com/acmeraptor/d45bbb6cca9dafebeaea10d872739951
from property_web_builder.
Great. I'll wait for confirmation from @dcallao and then I'll close this issue.
from property_web_builder.
@etewiah yup! it works now! Thx.
from property_web_builder.
Thanks for confirming @dcallao. I'll close this issue.
from property_web_builder.
Related Issues (20)
- Error when uploading images to Cloudinary HOT 2
- Mutiple Area Unit HOT 2
- Default Area Unit HOT 1
- Who's using PropertyWebBuilder?
- Google Maps API error: RefererNotAllowedMapError HOT 1
- Project communication channels HOT 1
- Googke Maps Api Key HOT 5
- Problem Deploying app to Heroku HOT 7
- Adding currency HOT 1
- How to edit code for the Heroku deloyed app HOT 2
- Error deploy to heroku HOT 4
- Document deployment to heroku alternative with a free plan HOT 14
- Alterntive to heroku HOT 1
- > I would love to work on this. Fly.io is a good alternative HOT 1
- Heroku error HOT 1
- Title: Security Vulnerability: Potential XSS Vulnerability in PropertyWebBuilder HOT 1
- Cant start app HOT 5
- Adding Philippine Peso to the currency. HOT 1
- Could not find gem 'globalize (~> 5.1.0.beta2)' HOT 5
- Customize admin views HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from property_web_builder.