Loomio

Automated setup of development environment - Ubuntu 14.04 LTS

G
GasparI Public Seen by 339

I'm putting together a script to install Loomio dev. env. easily:
https://github.com/sicambria/sh/blob/master/deploy/loomio1404-dev1.sh
https://github.com/sicambria/sh/blob/master/deploy/loomio1404-dev2.sh

It seems good so far. However, at localhost:3000, using email "default@loomio.com" and password "bootstrap_password" I get "Invalid email address or password."

How could I login?

F

FSF1967 Mon 25 Apr 2016

i have the same problem

JK

James Kiesel Mon 25 Apr 2016

Hm, this should be fixed now, as I've just updated the rake bootstrap task here to output a more useful username / password combination.

Failing this, a really quick way to get into a setup dev environment is to use the routes in app/controllers/development_controller.rb, which is what we use for our automated protractor testing. For example, navigating to localhost:3000/development/setup_discussion will create a fresh user, group, and discussion in the database, and navigate to it automatically.

Beware though that running these development routes does clear out the existing database.

F

FSF1967 Mon 25 Apr 2016

thank you, but sorry i'm not an expert on ruby and special environement used to install Loomio.

what command line must i write to update rake bootstrap ?

Thank you

G

GasparI Mon 25 Apr 2016

After trying a few times then I could login - and I got a blank screen.
Then I've purged everything - now I'm struggling with Ruby versions:
Your Ruby version is 1.9.3, but your Gemfile specified 2.3.0

$ rbenv global
2.3.0

$ ruby -v
ruby 1.9.3p551 (2014-11-13) [x86_64-linux] Brightbox

G

GasparI Mon 25 Apr 2016

Ruby issue went away after running apt-get autoremove.

@jameskiesel
When I'd like to run "rake bootstrap" I get this error now:

$ rails c
Loading development environment (Rails 4.2.5.2)
irb: warn: can't alias context from irb_context.
irb(main):001:0> rake bootstrap
NameError: undefined local variable or method bootstrap' for main:Object
from (irb):1
from /var/lib/gems/2.3.0/gems/railties-4.2.5.2/lib/rails/commands/console.rb:110:in
start'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.2/lib/rails/commands/console.rb:9:in start'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:68:in
console'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:39:in run_command!'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.2/lib/rails/commands.rb:17:in
'
from script/rails:6:in require'
from script/rails:6:in
'

G

GasparI Mon 25 Apr 2016

Sorry, the previous command was entered to the rails console - not the right place. However, still not good. The rest of the error log is attached:

~/projects/loomio$ rake bootstrap --trace
** Invoke bootstrap (first_time)
** Execute bootstrap
Hold on, project is starting
** Invoke bootstrap:dependencies (first_time)
** Execute bootstrap:dependencies
rake aborted!
Airbrake::Error: the 'default' notifier isn't configured

JK

James Kiesel Mon 25 Apr 2016

Should be fixed in the latest; try pulling down master and running rake bootstrap from the command line. (it looks like in your previous post you're running rake bootstrap from the rails console?)

G

GasparI Mon 25 Apr 2016

Yes, by mistake. But then I ran it outside the console - that gave the "Airbrake" error message.

F

FSF1967 Mon 25 Apr 2016

ok
so i run "rake bootstrap" and after "rails s"

I open the url "localhost:3000", write the login an password (it'seems working) and i arrived on a blank page with url "localhost:3000/profile"

I can make nothing of other one because no action is possible on this blank page

F

FSF1967 Mon 25 Apr 2016

this is the message in the rail's terminal when i'm trying to open admin session with default@loomio.com and the right password

RG

Rob Guthrie Mon 25 Apr 2016

Hi. You need to

cd angular
gulp dev

Then visit localhost:3000 again.

JK

James Kiesel Mon 25 Apr 2016

I'm writing a quickstart guide which will make this info a bit easier to access: https://github.com/loomio/loomio/blob/quickstart/docs/en/development_handbook/quickstart.md

F

FSF1967 Tue 26 Apr 2016

Thank you

For this installation I begin again has to leave a new virtual machine or it is to be made following the installation described in this tuto https://github.com/loomio/loomio/blob/master/docs/en/development_handbook/setup_development_environment.md ?

I follow your instructions:
rake bootstrap
cd angular
gulp dev

and the system returns me this message
~/projects/loomio/angular# gulp dev
No command 'gulp' found, did you mean:
Command 'gslp' from package 'ghostscript' (main)
gulp: command not found

G

GasparI Tue 26 Apr 2016

This helped me:
sudo ln -s /usr/bin/nodejs /usr/bin/node

I'm updating my installer scripts (on the top) very soon - I'd appreciate feedback if you can try them out.

JK

James Kiesel Tue 26 Apr 2016

That error message suggests that gulp isn't installed, although rake bootstrap should be installing gulp for you. What's the output of npm install -g gulp?

F

FSF1967 Tue 26 Apr 2016

No problem

Update your scripts and i test them immediatly.

"sudo ln -s /usr/bin/nodejs /usr/bin/node" don't solved the gulp dev command returns

F

FSF1967 Tue 26 Apr 2016

With the good line of command for the installation it gets much better but i have an error: Error: Cannot find module 'gulp-sass'

F

FSF1967 Tue 26 Apr 2016

arghhh i always have a blank page after login to localhost:3000 :(

G

GasparI Tue 26 Apr 2016

Oh joy! Up and runnin' in less than 20 minutes - tested on a vanilla Ubuntu VM :)

cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/loomio1404-dev1.sh; chmod +x loomio1404-dev1.sh;./loomio1404-dev1.sh
cd;wget https://raw.githubusercontent.com/sicambria/sh/master/deploy/loomio1404-dev2.sh; chmod +x loomio1404-dev2.sh;./loomio1404-dev2.sh

@jameskiesel - the 2nd script is almost the same as the 1st (just less commands) - do you know why it's not successful for the first time?

F

FSF1967 Wed 27 Apr 2016

Thank you for your fantastic job
I'm using your scripts on my ubuntu 14.04LTS VM and have launch the first script.

gulp still runs but the script remains blocked at this level:

G

GasparI Wed 27 Apr 2016

@fsf1967 yes, I think it's intended that gulp stays active while you develop.
Just open a new terminal, go to ~/projects/loomio folder, and run rails s.

JK

James Kiesel Thu 28 Apr 2016

This is great work, @gaspari, thanks.

I'm having trouble parsing that last question; what's not successful the first time?

A couple notes:

  • We shouldn't be using bower at all anymore, so npm install -g bower shouldn't be needed
  • We require gulp-sass in our angular/package.json, so not sure why we'd need to install it globally. I'd be more inclined to rm -rf node_modules; npm install to get gulp-sass going if it doesn't work
  • rake bootstrap should run both db:setup and bundle install, so I don't think those bits need to be in here. If anything the permission granting lines should move into bootstrap.rake
  • The bootstrap task assumes OSX at the moment (ie, it runs brew install <thing>, but that's obviously not the best. Maybe you'd have interest in adopting it to run correctly on Ubuntu as well?

My ideal solution for this would be a rake task which can be run immediately after cloning the repository, and ideally works on OSX and Ubuntu. I think the package installation, DB setup, and even rbenv stuff can all live in there. Thoughts?

G

GasparI Thu 28 Apr 2016

Thanks James, you've answered my question in great detail :)
I agree, making rake Ubuntu-compatible would be the best.
I'd love to contribute more to this but my MSc deadline is closing and I now must focus on developing 1-2 functions/modules.

F

FSF1967 Tue 26 Apr 2016

the return of the terminal:

F

FSF1967 Thu 28 Apr 2016

pffff i don't know what's going wrong

Since yesterday the console remains blocked as indicated higher

and today a write the command rails s ans this is the return:

~/projects/loomio# rails s
git://github.com/robguthrie/mail.git (at memoize-encoded@47c87d5) is not yet checked out. Run bundle install first.
~/projects/loomio#

thank you for your help

G

GasparI Thu 28 Apr 2016

Btw, the console is not "blocked". You can press ctrl-c to exit gulp dev. You don't need that running to see the Loomio interface.

F

FSF1967 Thu 28 Apr 2016

so i enter "bundle install", and after rails s

The return is on the file join to this post.

loomio don't works

G

GasparI Thu 28 Apr 2016

  1. Run this and try again running BOTH scripts (sometimes there are network glitches and github download fails...):
    https://github.com/sicambria/sh/blob/master/deploy/loomio1404-dev-purge.sh

  2. Or start from a fresh Ubuntu installation:
    https://www.youtube.com/watch?v=Xbs6Nesft5c

F

FSF1967 Thu 28 Apr 2016

Thank you for your help, loomio is working on my VM :thumbsup:

As i want use loomio in production only now i have some more questions

  • Loomio is not reachable with the url http://ip_of_the_vm:3000 how can i make it reachable?

  • I understand that a need to write the command "rails s" for lauching loomio server at each start of my VM? it's true?

  • how can i configure smtp server and domain server in loomio (important for the registration of my users)

Thank you

G

GasparI Thu 28 Apr 2016

For production install, check this page:
https://github.com/loomio/loomio-deploy

If you run into troubles, check other threads in the install group, you'll probably find answers you need.

J

joesab Sun 26 Jul 2020

Hi just wondering if there a current automatic install script I could find any ? i love @GasparI's idea of a automated install I tried the old scripts no luck and following the ofical install I got lost