Loomio

Ubuntu 16.04 LTS development setup

GasparI PublicSeen by 415

I'm porting the Loomio dev. env. installer to Ubuntu 16.04 x64 but got a weird "not found" error. Any ideas?

Scripts:
cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/env/ruby/ruby230.sh; chmod +x ruby230.sh; ./ruby230.sh
cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/env/node/nvm0-10-25.sh; chmod +x nvm0-10-25.sh; ./nvm0-10-25.sh
cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/loomio1604-dev1.sh; chmod +x loomio1604-dev1.sh; ./loomio1604-dev1.sh
cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/loomio1604-dev2.sh; chmod +x loomio1604-dev2.sh; ./loomio1604-dev2.sh

When starting gulp dev:
See attached error log.

Robert Guthrie

Sorry, what installer are you referring to?

Have you been through setup your development environment? I updated that recently, it's a good place to start.

From that point on it's easy to checkout, bundle install, npm install, rake db:setup and rails s

GasparI

I wrote this script to fully automate the install for Ubuntu 16.04
It works for Ubuntu 14.04:
https://www.loomio.org/d/ar62Nty4/automated-setup-of-development-environment-ubuntu-14-04-lts

I run into this error when I want to run gulp dev

[16:09:51] Tested 31 tests, 31 passes, 0 failures: PASS
[16:09:58] Finished 'vendor' after 8.63 s
fs.js:839
  return binding.lstat(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, lstat '/home/gaspar/projects/loomio/angular/core/components/templates.js'
  at Error (native)
  at Object.fs.lstatSync (fs.js:839:18)
  at DestroyableTransform.TransformStream [as _transform] (/home/gaspar/projects/loomio/angular/node_modules/gulp-angular-templatecache/node_modules/gulp-header/index.js:38:12)
  at DestroyableTransform.Transform._read (/home/gaspar/projects/loomio/angular/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)

Robert Guthrie

templates.js does not exist.. so I guess you need to confirm that template building step is working.

Sorry, I don't have much of a clue how to help.

GasparI

Ok, this is rather a nice to have.
Ubuntu 14.04 is supported until 2019, I'll stick to it.

Quentin Grimaud

Hi, a few days ago I have also followed the kind of 2-part tutorial to install loomio for development ( part1 part2 ) on my Ubuntu 16.04 computer.

Here are notes about the small difficulties I encountered during the installation, and how I solved them, in case it could help others or be used to improve the installation documentation:

In the first part (setup_environment.md), the instructions after "Now build and install node" do not work initially, because nvm has just been installed and is not in the PATH of the terminal yet. If you have the same problem, you can either close the current terminal and open another one, or run "source ~/.bashrc".

In the second part (quickstart.md), I saw the "If you're on OSX then you can run the following bootstrap task" step. I understood that as I am on Ubuntu I should not run it. But I felt unconfortable because I wanted the things this task does to be executed, because I guess otherwise I would get stuck at some point without them (which happend to be true: at the step when we move to folder "loomio/angular" and run "gulp compile", it throwed an error). So I tried to see what terminal commands this task runs, by reading the contents of Rakefile and lib/tasks/bootstrap.rake .

The bootstrap:dependencies subtask installs (in a OSX-specific way) the same things as I previously installed in the Ubuntu section of setup_environment.md, and also runs bundle install and cd angular && npm install && cd ... So I decided to run these manually.

(But now I understand that as the OSX-specific installation commands that the task runs are conditionnal to these items not being already installed, and as I have already installed all of them in the setup_environment.md step, it should just work to simply run rake bootstrap, so I guess we can replace the "If you're on OSX then" phrase by something like "If you're on OSX or if you are on Ubuntu and have already executed the setup_environment.md part")

Running the first bundle install command ends in an error, telling me that I should run 'apt-get install libsqlite3-dev'. So I install it and run the command again (I run sudo apt-get install libsqlite3-dev, and gem install sqlite3 -v '1.3.11', and bundle install) and the commands succeeds. (maybe we should add libsqlite3-dev to the "sudo apt-get install" list in setup_environment.md)

Running the second command ("cd angular && npm install") worked without problem.

From reading the code of the remaining steps of the bootstrap task, they don't seem to be OSX-specific, so I run the full bootstrap task again: rake bootstrap. It outputs this error 'FATAL: role "quentin" does not exist', right after "Database.yml file created".

So it seems that loomio needs to log in to the postgres database using the username currently logged in on the computer, and this username seems to have no role created in the database yet. To create it, I ran:
whoami > /tmp/whoami.log
sudo -u postgres psql -c "CREATE USER cat /tmp/whoami.log WITH PASSWORD '';"
sudo -u postgres psql -c "ALTER USER cat /tmp/whoami.log CREATEDB;"

And I tried the rake bootstrap command again, and get this error:
PG::InsufficientPrivilege: ERROR: permission denied to create extension "hstore"
HINT: Must be superuser to create this extension.

So I gave more permissions to the SQL user:
sudo -u postgres psql -c "ALTER USER cat /tmp/whoami.log SUPERUSER;"

And I tried the rake bootstrap command again, and this time it worked, outputting "Created user with email default@loomio.org and password 'fc4e0a03'"

So I ran rake bootstrap:run, and went to http://localhost:3000/ and logged in.