Dan Tappin

Joined

8,820 Experience
5 Lessons Completed
9 Questions Solved

Activity

Posted in Errors Following the Deploy Rails Tutorial

I am literally following the Setup and Deploy tutorials line for line. I have my local dummy rails app up and running and I am trying to run my first deploy to DigitalOcean. Here is the error I am seeing:

DEBUG[700595ea]     Could not locate Gemfile
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 104.236.162.251: bundle exit status: 10
bundle stdout: Nothing written
bundle stderr: Nothing written

There is way more dumped out here but this is the line that triggers it. I already stumbled on the requirement to manually upload your database.yaml file so is this the case again here?

Dan

Posted in Setup MacOS 10.10 Yosemite Discussion

I missed the Postgres post-install step where you create the database structure etc. once I did that it was all good. To many terminal tabs open and lost track of what I was doing :)

Posted in Setup MacOS 10.10 Yosemite Discussion

Same here:

rake db:create

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"?

Posted in Styling with Bootstrap Sass Discussion

Hmmm... not sure what I did but must be an issue with TextMate. Opened my Gemfile again and my gem 'bootstrap-sass', '~> 3.2.0.2' declaration was gone - added it back in and it seems to work now.

Posted in Styling with Bootstrap Sass Discussion

Followed the instructions but the gem does not seem to be loading. The bundle command runs but it is not getting installed. I tried a manual install of the gem but all you get when you load a page is a thrown exception:

File to import not found or unreadable: bootstrap

The scss page tries to load bootstrap but the gem isn't loaded.

I am going to guess it's a rails version or dependency issue but not sure where to start.

I think this is basically like I had set it up but I had the Role model to glue the users to the accounts. This is what authorized the users to switch to a given account and what type of user they were.

I need to dig into Devise and CanCanCan more but I am thinking that I should just be able to use Devise as planned and then add a layer of authorization with CanCanCan using the users Role to set the user type (guest, admin etc.)

I while back I was playing around building an app where you had multiple tenants (Company Model) and a single login (User Model). I then created roles (Role Model) to link the users to the tenants. These roles would typically include "guest", "contractor", "admin" etc. I would then use this to authenticate the users access to various resources associated to each tenant. So one user could be a guest for one company and an admin for the next. This way they had a single login etc.

It works pretty good but I was thinking that I should really try to use Devise for the authentication and CanCanCan for the authorization. After some Googling there seems to be a few approaches to this but nothing seems to just out at me as an elegant use of Devise and CanCanCan to accomplish this vs a from scratch solution.

It seems most of the solutions use subdomains which I could use but I would rather not. Devise-basecamper (https://github.com/digitalopera/devise-basecamper) seems like on the right track but its based pin CanCan and looks a bit stale.

Any ideas would be appreciated.

Thanks,

Dan

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.