-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User error on seeding db #38
Comments
Hello there,
From the console run this command and let me know the result:
|
jasonl@wyo-jol-uws01:~/jason$ rails c -- I didn't even know how to access the rails console until now.. |
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:
After that try seeding the db again:
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. |
Well, the same error occurred: (not the full trace this time) rails pwb:db:seed 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. |
Very strange. Can you go to the console again and try running this to see if it works:
|
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 |
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 |
Ok, I commented out the following line: . def seed_contacts yml_file ^^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 |
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:
Let me know if that works. |
Now I have this: https://gist.github.com/acmeraptor/6929b2373271dc34c8581107cd46405a |
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. |
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. |
hi @etewiah! I am stuck with the same error. I got rvm with
Do you think you can help me out here? Im on Skype via dancallao |
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 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. |
Good to hear @acmeraptor - any other problems just go ahead and open another issue and I'll help you resolve it. |
I'll keep up with this thread since someone else is having the same issue. The latest gist: https://gist.github.com/acmeraptor/27e549a6713e09405106e4e3a84e9e81 |
Sorry guys, I missed out on adding the "optional: true" statement in the belongs_to page relationship for the link model. |
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 |
Great. I'll wait for confirmation from @dcallao and then I'll close this issue. |
@etewiah yup! it works now! Thx. |
Thanks for confirming @dcallao. I'll close this issue. |
Hello, I'm new to ruby on rails so forgive me if this is a newbie mistake. I followed the guide here to install ruby on rails on my ubuntu server: https://gorails.com/setup/ubuntu/14.04
I then followed your guide on installing pwb. When I get to the rails pwb:db:seed step I get the following (full traced) error: https://gist.github.com/acmeraptor/152000f7a0efd9bb5642b2df5fc48728
I have tried various ways to make sure that the postgre user exists and is known in the config/database.yml file but I can't tell if my RoR setup is faulty or if I missed some intuitive step on your guide.
Any ideas?
~acme
The text was updated successfully, but these errors were encountered: