These are chat archives for fieldpapers/fieldpapers

10th
Jul 2015
Seth Fitzsimmons
@mojodna
Jul 10 2015 02:52
@Priyanka050 i'm around and puttering on various things / eating dinner, ready whenever.
Priyanka050
@Priyanka050
Jul 10 2015 03:03
Hi seth
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:03
hey
Priyanka050
@Priyanka050
Jul 10 2015 03:03
yes
and currently m facing the same error "connection_specification.rb:173:in `spec': database configuration does not specify adapter "
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:07
is MySQL running?
you're on Linux, correct?
what does echo $DATABASE_URL respond with?
Priyanka050
@Priyanka050
Jul 10 2015 03:07
I'am using ubuntu 14.04
I have completed installing the dependencies and have reached the part where we have to restart rails
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:08
ok, great
Priyanka050
@Priyanka050
Jul 10 2015 03:08
It doesnt respond with anything
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:10
before starting rails again, export DATABASE_URL=mysql2://root@localhost/fieldpapers_development
Priyanka050
@Priyanka050
Jul 10 2015 03:11
where is this line supposed to be added?
like in which file?
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:11
(that's what direnv and the .env file do)
just run it on the command line
Priyanka050
@Priyanka050
Jul 10 2015 03:12
yea run that
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:13
now try echo $DATABASE_URL just to make sure that it got set
Priyanka050
@Priyanka050
Jul 10 2015 03:13
now i get mysql2://root@localhost/fieldpapers_developmentecho
when i do "echo $DATABASE_URL
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:13
great
Priyanka050
@Priyanka050
Jul 10 2015 03:14
its set
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:14
before restarting rails, run rake db:migrate
(updating the docs)
that will initialize all of the tables that need to exist
Priyanka050
@Priyanka050
Jul 10 2015 03:16
it says "rake aborted"
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:16
can you paste the full error message?
once that finishes running, you should be able to run rails server -b 0.0.0.0
Priyanka050
@Priyanka050
Jul 10 2015 03:16
error : Cannot load Rails.application.database_configuration:
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:18
i'm trying to reproduce that now...
Priyanka050
@Priyanka050
Jul 10 2015 03:18

full error message

/var/lib/gems/2.2.0/gems/bundler-1.10.5/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local/fp-web/bin in PATH, mode 040777
rake aborted!
Cannot load Rails.application.database_configuration:
Unknown alias: default

Tasks: TOP => db:migrate => environment

Seth Fitzsimmons
@mojodna
Jul 10 2015 03:19
try chmod -R a-w /usr/local/fp-web and then re-run rake db:migrate
i think the "Insecure ..." message is pointing at the root cause
Priyanka050
@Priyanka050
Jul 10 2015 03:21
im still getting the same error
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:22
same mode?
err, that's just a warning
can you try ls -l config/database.yml and paste the result?
Priyanka050
@Priyanka050
Jul 10 2015 03:25
-r-xr-xr-x 1 root root 1281 Jul 8 20:38 config/database.yml
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:25
also, what version of ruby are you using? ruby -v
can you paste the contents of database.yml?
Priyanka050
@Priyanka050
Jul 10 2015 03:29
ruby 2.2.2
Hey can we have a skype call?
I cant find a way to do file transfers here

default: &default

encoding: utf8

pool: 5

url: <%= ENV["DATABASE_URL"] %>

default:
adapter: mysql2
encoding: utf8
pool: 5
username: priyanka
password: qwerty
host: localhost

development:
<<: *default

Warning: The database defined as "test" will be erased and

re-generated from your development database when you run "rake".

Do not set this db to the same as development or production.

test:
<<: *default
url: <%= ENV["TEST_DATABASE_URL"] %>

As with config/secrets.yml, you never want to store sensitive information,

like your database password, in your source code. If your source code is

ever seen by anyone, they now have access to your database.

#

Instead, provide the password as a unix environment variable when you boot

the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database

for a full rundown on how to provide these environment variables in a

production deployment.

#

On Heroku and other platform providers, you may have a full connection URL

available as an environment variable. For example:

#

DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"

#

You can use this database configuration with:

#

production:

url: <%= ENV['DATABASE_URL'] %>

#
production:
<<: *default

Seth Fitzsimmons
@mojodna
Jul 10 2015 03:30
aha, that's the problem
(well, the current problem, anyway)
the version of config/database.yml on GitHub is set up so that it doesn't need to be edited
you should revert to that now that DATABASE_URL is set
Priyanka050
@Priyanka050
Jul 10 2015 03:31
okay
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:33
(the technical reason is that there are 2 default keys in there and only the first is set up as an anchor (&default))
Priyanka050
@Priyanka050
Jul 10 2015 03:33
wait i ll get the github version once again
okay
just givmme a min
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:34
sure, np
Priyanka050
@Priyanka050
Jul 10 2015 03:38
yea i cloned again
when i try to do
"bundle install --path vendor/bundle"
what premission are to be given to it?
Priyanka050
@Priyanka050
Jul 10 2015 03:44
im getting an error
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:44
you should be able to do it as a non-privileged user (w/o sudo). it'll create vendor/bundle on its own (and shouldn't require specific permissions to be set)
Priyanka050
@Priyanka050
Jul 10 2015 03:45
Errno::EACCES: Permission denied @ dir_s_mkdir - /usr/local/fp-web/.bundle
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:46
what's the error?
Priyanka050
@Priyanka050
Jul 10 2015 03:46
Hey Is it not possible to have a skype call i think it would speed things up
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:46
how did you clone? did you change permissions after?
sorry, i'm also doing a couple other things right now
Priyanka050
@Priyanka050
Jul 10 2015 03:47
okay np
i cloned it in /usr/local
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:48
(fwiw, i usually work in ~/src rather than /usr/local in order to simplify permissions)
using sudo or as you?
(how did it get chmod'd 755 last time?)
Priyanka050
@Priyanka050
Jul 10 2015 03:51
using sudo
I changed the permissions
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:52
try cloning as you somewhere under your home directory
then you won't need to futz with permissions
Priyanka050
@Priyanka050
Jul 10 2015 03:55
okay
when i do "gem install bundler " i get Permission denied @ rb_sysopen - /var/lib/gems/2.2.0/gems/bundler-1.10.5/lib/bundler.rb
Seth Fitzsimmons
@mojodna
Jul 10 2015 03:59
that you'll need to sudo because it installs into /var/lib/gems or somewhere system-like.
(i think that's the only command that requires it though)
Priyanka050
@Priyanka050
Jul 10 2015 04:02
but after that when i run "bundle install --path vendor/bundle"
yes
thats done
I get
/var/lib/gems/2.2.0/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/shell/basic.rb:356: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Could not locate Gemfile or .bundle/ directory
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:05
are you in the directory you cloned into?
is there a Gemfile in the current directory?
Priyanka050
@Priyanka050
Jul 10 2015 04:06
yes I'am in the same diresctory
yea thats working now
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:09
i just sketched out some docs for Ubuntu installation that should be better: https://github.com/fieldpapers/fp-web/blob/master/README.md#ubuntu
Priyanka050
@Priyanka050
Jul 10 2015 04:10
thanks a lot
I'am trying that now
I had actually started working on fieldpapers like a month ago
That time the python code was up
Now that the code has been changed to ruby
I'am finding it a little difficult to find the flow of code
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:14
if not, it'd probably help to go through one of the screencasts or tutorials
have you worked on rails apps before?
Priyanka050
@Priyanka050
Jul 10 2015 04:14
yea
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:14
it's been a while since we've done much rails development, so i wouldn't exactly consider field papers as representative of best practices
they do tend to be fairly uniform once you're familiar with the framework (vs. the totally bespoke PHP framework the previous version used)
Priyanka050
@Priyanka050
Jul 10 2015 04:15
we can do that today or should we schedule that for some other time?
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:16
let me see if i can find some tutorials that look good
i'm going to have to go fairly soon
Priyanka050
@Priyanka050
Jul 10 2015 04:17
okay
hey when i do "foreman run rake db:migrate"
i get error stating
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:20
this looks interesting: http://railsforzombies.org/
Priyanka050
@Priyanka050
Jul 10 2015 04:21
rake aborted!
Unknown database 'fieldpapers_developmentecho'
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:22
export DATABASE_URL=mysql2://root@localhost/fieldpapers_development
(the "echo" shouldn't be there)
if you didn't already create it, rake db:create will
Priyanka050
@Priyanka050
Jul 10 2015 04:24
okayy
also https://github.com/fieldpapers lists many folders like fp-tasks,fp-legacy etc etc
just having fp-web will help me run fieldpapers locally?
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:26
that'll give you the web UI
you'll need fp-tasks in order to create prints
you'll need fp-tiler in order to browse snapshots (but that can also be run as a Docker container)
(you can sidestep installation and run it as a Docker container)
Priyanka050
@Priyanka050
Jul 10 2015 04:28
what if i dont use docker and place all of them in a single directory in my system?
Kate Chapman
@wonderchook
Jul 10 2015 04:28
probably be easier to run as a docker container
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:29
(they also have all of the necessary installation and configuration steps baked in already)
the Python printing code has some pretty crazy dependencies, so it's much easier if you use the Docker containers to manage that
@wonderchook: have you had a chance to get it running yet? (if not, i figure this is paving the way somewhat)
Priyanka050
@Priyanka050
Jul 10 2015 04:30
Mysql2::Error: Table 'fieldpapers_development.users' doesn't exist: ALTER TABLE users ADD encrypted_password varchar(255) DEFAULT '' NOT NULL/home/priyanka/fp-web/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:299:in `query'
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:31
that assumes that you already have a users table from an existing database dump.
Kate Chapman
@wonderchook
Jul 10 2015 04:31
I just got distracted
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:31
i need to fix that--that's a blocker to getting things running.
ah, shoot.
:eyes:
Priyanka050
@Priyanka050
Jul 10 2015 04:32
how to get rid of that initially?
Kate Chapman
@wonderchook
Jul 10 2015 04:32
sigh gitter is doing weird things with order of messages today
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:32
:star2:
Kate Chapman
@wonderchook
Jul 10 2015 04:32
I hadn't gotten everything running, I hadn't gotten stuck though
powering on my virtual machine to see if I can remember what I was doing
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:33
i'll need to get you a copy of the database schema from a dump
(not as quick as updating docs) i'll do that tomorrow and ping you once i've got it.
sorry we didn't get it running now, but you've now gotten further than anyone except sean and me. (thanks for being the guinea pig)
Priyanka050
@Priyanka050
Jul 10 2015 04:36
np
Thanks for the help guys
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:37
sure!
Priyanka050
@Priyanka050
Jul 10 2015 04:38
also temme when you get the dump
and if i still get stuck can we have another chat like this at some time?
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:39
definitely to both
@Priyanka050 i just remembered that foreman run rake db:schema:load may actually work
(you may need to drop and recreate the database first)
foreman run rake db:create
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:45
foreman run rake db:drop
Priyanka050
@Priyanka050
Jul 10 2015 04:46
hey yea that works
now i just have to include all the other folders in a docker right?
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:48
great! i need to take off. if you run into more stuff, post it here and i'll respond tomorrow
kinda. you don't actually need to clone them to be able to run them
Priyanka050
@Priyanka050
Jul 10 2015 04:49
Is there something with you guys which describes the flow of fieldpapers?(as in the ruby flow of code) ?
yea sure
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:50
there are public images here: https://quay.io/organization/fieldpapers
Priyanka050
@Priyanka050
Jul 10 2015 04:51
Okay I'll get back to you if i face more problems
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:51
no flow documentation now--can you drop some questions in here that you would want to address? i'm not sure what would be most useful
to run, say, fp-tasks, docker run --rm -p 8080:8080 quay.io/fieldpapers/fp-tasks
(i also realized that since both of you are effectively on Linux (in VMs or otherwise), you'll have fewer problems than i did when orchestrating the different services, since they're all listening on the same host, through docker or not)
Priyanka050
@Priyanka050
Jul 10 2015 04:53
okay
Seth Fitzsimmons
@mojodna
Jul 10 2015 04:54
i'm out. have a good day!
Kate Chapman
@wonderchook
Jul 10 2015 04:57
good night!
Priyanka050
@Priyanka050
Jul 10 2015 09:34

when i try to get image for fp tasks by running "docker run --rm -p 8080:8080 quay.io/fieldpapers/fp-tasks";

I get : Get https://quay.io/v1/repositories/fieldpapers/fp-tasks/images: dial tcp: lookup quay.io: no such host

Seth Fitzsimmons
@mojodna
Jul 10 2015 17:51
woops, had the wrong image name. this works for me: docker run --rm -p 8080:8080 quay.io/fieldpapers/tasks:v0.9.0