Closed experimatt closed 6 years ago
1) Following the readme instructions using vagrant yields this error:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set network interfaces...
The specified host network could not be found: 'sessionizer.'
If the name specification is removed, Vagrant will create a new
host only network for you. Alternatively, please create the
specified network manually.
2) Removing name: APP_NAME
from
config.vm.network "private_network", ip: "192.168.100.185", name: APP_NAME
in the Vagrantfile
fixes that, but errors out in the postgres ansible step:
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_XMNStJ/ansible_module_postgresql_user.py", line 779, in main
db_connection = psycopg2.connect(**kw)
File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
connection_factory=connection_factory, async=async)
OperationalError: FATAL: Peer authentication failed for user "postgres"
fatal: [default]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"conn_limit": null,
"db": "",
"encrypted": false,
"expires": null,
"fail_on_user": true,
"login_host": "",
"login_password": "",
"login_unix_socket": "",
"login_user": "postgres",
"name": "vagrant",
"no_password_changes": false,
"password": null,
"port": "5432",
"priv": null,
"role_attr_flags": "CREATEDB,NOSUPERUSER,NOCREATEROLE",
"ssl_mode": "prefer",
"ssl_rootcert": null,
"state": "present",
"user": "vagrant"
}
},
"msg": "unable to connect to database: FATAL: Peer authentication failed for user \"postgres\"\n"
}
to retry, use: --limit @/Users/mdecuir/projects/sessionizer/vagrant/ansible/development.retry
PLAY RECAP *********************************************************************
default : ok=8 changed=5 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.```
3) Updating database.yml
to set the user to postgres
instead of vagrant
, like so
username: postgres
password:
username: localhost
port: 5432
and trying to setup the DB the rails way also errors out:
/Users/mdecuir/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/icalendar-1.5.4/lib/icalendar/conversions.rb:38: warning: constant ::Fixnum is deprecated
/Users/mdecuir/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/icalendar-1.5.4/lib/icalendar/conversions.rb:44: warning: constant ::Bignum is deprecated
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "username"=>"localhost", "password"=>nil, "port"=>5432, "database"=>"sessionizer_development"}
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create
(See full trace by running task with --trace)```
I can provide a local build solution similar to the one I used on the Adopt-a-Tree project for Open Twin Cities (https://github.com/OpenTwinCities/adopt-a-tree). It involves providing a custom Docker image and a 1-step build script. My solution will allow anyone who joins the project to be up and running in minutes, not hours or days. You'll even be able to delete the project from your local machine, reset your development environment, set up the project again, and be back in business in 5 minutes.
There's Ruby on Racetracks, and there's Not Exactly. Make sure you choose the correct one. Go to http://www.rubyonracetracks.com/ for more details.
@jhsu802701 we'll pass. @tonyc got the vagrant-ized setup working correctly. thanks though!
I haven't yet figured out how to get the app running locally -- either with Vagrant or rails. Something's either not right in the readme or the config. See comments below for details.