Gerard Donnelly

Joined

1,830 Experience
0 Lessons Completed
2 Questions Solved

Activity

Posted in Deploying Tailwind to AWS Elastic Beanstalk

Thanks for the feedback Chris.

I finally managed to get it sorted by following this post of the same issue: https://istvan.co/how-to-install-node-yarn-on-elastic-beanstalk/

Posted in Deploying Tailwind to AWS Elastic Beanstalk

Thanks for coming back so quickly Chris.

Unfortunately it still didn't work. Got the error:

Aborting the operation. [Instance: i-070afc6bfda831a60] Command failed on instance. Return code: 1 Output: Loaded plugins: priorities, update-motd, upgrade-helper No package nodejs available. Error: Nothing to do. command 02_install_node in .ebextensions/01_rails_deploy.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

I also tried writing it like:

commands:
00_remove_old_node_if_present:
command: "/bin/rm -rf /var/cache/yum && /usr/bin/yum remove -y nodejs && /bin/rm /etc/yum.repos.d/nodesource* && /usr/bin/yum clean all"
ignoreErrors: true
01_add_node:
command: "curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -"
02_install_node:
command: "yum install nodejs"
03_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo"
04_install_nodejs:
command: "yum -y install yarn"

Stumped with it.

Here is what the activity log shows. It seems to find Node JS download but then can't find it to install: https://ibb.co/gFPq9Qk

I'd be grateful of any other advice.

Posted in Deploying Tailwind to AWS Elastic Beanstalk

I was wondering if anyone has experience of deploying A Rails 6 app with Tailwind to AWS Elasticbeanstalk.

I have tried a dozen times now however the build keeps failing.

I am getting the following error in code pipeline:

Action execution failed Deployment completed, but with errors: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version. Failed to deploy application. Unsuccessful command execution on instance id(s) 'i-0ef9ce5572262bb0d'. Aborting the operation. [Instance: i-0ef9ce5572262bb0d] Command failed on instance. Return code: 1 Output: (TRUNCATED)...cy: nodejs for package: yarn-1.22.15-1.noarch --> Finished Dependency Resolution Error: Package: yarn-1.22.15-1.noarch (yarn) Requires: nodejs You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest. command 01_install_yarn in .ebextensions/01_rails_deploy.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

The start of file 01_rails_deploy.config in my .ebextensions directory looks like this:

commands:
00_remove_old_node_if_present:
command: "/bin/rm -rf /var/cache/yum && /usr/bin/yum remove -y nodejs && /bin/rm /etc/yum.repos.d/nodesource* && /usr/bin/yum clean all"
ignoreErrors: true
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install yarn -y"
02_install_nodejs:
command: "yum -y install nodejs"
03_mkdir_webapp_dir:
command: "mkdir /home/webapp"
ignoreErrors: true
04_chown_webapp_dir:
command: "chown webapp:webapp /home/webapp"
ignoreErrors: true
05_chmod_webapp_dir:
command: "chmod 0744 /home/webapp"
ignoreErrors: true

Any help would be super appreciated.

Posted in Devise is driving me crazy

I solved this. I had a default port in my environments.rb file and then localhost was also being declared in my developments.rb which was causing a conflict as it was using port 465 in dev.

Posted in Devise is driving me crazy

Hi Guys,
Please can someone help me. I have set up sendGrid with devise. I have followed numerous tutorials and done everything correct but after a user signs up the log file site with the following lines:

 Rendering devise/mailer/confirmation_instructions.html.erb
 Rendered devise/mailer/confirmation_instructions.html.erb (Duration: 0.4ms | Allocations: 91)
Devise::Mailer#confirmation_instructions: processed outbound mail in 3.7ms

After what seems like an enternity the actual page redirects on the front end and the log updates with the following. If you look at the Delivered Mail line and the Message ID they contain some crazy random email address with my Macbook name.

Delivered mail 5e7293e497bf4_4b8a3ff2574a84c04004a@Gerards-MBP-2.mail (60180.2ms)
Date: Wed, 18 Mar 2020 21:34:28 +0000
From: hey@test.com
Reply-To: hey@test.com
To: gerarddonnelly@googlemail.com
Message-ID: <5e7293e497bf4_4b8a3ff2574a84c04004a@Gerards-MBP-2.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>Welcome gerarddonnelly@googlemail.com!</p>

<p>You can confirm your account email through the link below:</p>

<p><a href="http://localhost:3000/users/confirmation?confirmation_token=bJiYjwaRVzvbDPc7F9Y4">Confirm my account</a></p>

Redirected to http://localhost:3000/verify
Completed 302 Found in 62111ms (ActiveRecord: 75.1ms | Allocations: 33693)

If anyone could help me with this I would be so greatful. Its cost me a day and half so far.

Thanks for your help in advance.

Thanks,

Gerard

Posted in Setting background image from User uploaded asset

Hi Chris,

Thanks for your help on this. I eventually got it solved. The following worked:

style="background-image: url(<%= rails_blob_url(@creator.header_image) %>)"

Thanks,

Gerard

Posted in Setting background image from User uploaded asset

Hi Chris,

Thanks for taking the time to help me. The funny thing is there is an image attached. If I just add the image tag on the page it loads fine:

<%= image_tag(@creator.header_image, style: 'width:100%') %>

Posted in Setting background image from User uploaded asset

Hi Chris,

Weird. I tried your solution but still no luck. See image. I am using active storage. See image of error. "The asset "" is not present in the asset pipeline."

[img]https://i.imgur.com/7fpogii.png[/img]

If I just add it to a div on the page to test, it will show up.

Posted in Setting background image from User uploaded asset

Hi,

I am trying to set a user uploaded image as the background for their profile but cant seem to get it working. I'm stuck on what way to reference the image in the background css style. I'm using Rails 6.

style="background url('<%= image_tag(@creator.profile_image) %>')"

style="background url('<%= @creator.header_image %>')"

Any help would be greatly appriciated.

Thanks,

Gerard

Posted in Is there a acts_as_taggable gem that works on Rails 6?

The acts_as_taggable gem only supports upto rails 5.

Appologies if this is a stupid question.

Thanks,

Gerard

Posted in Flatpickr with "Present" value as well.

Thats a great help Chris.

Thanks.

Posted in Flatpickr with "Present" value as well.

Thanks for your explanation Chris.
To confirm.

Have 3 fields:
Start Date - Date Field
End Date - Date Field
Currently Working - Boolean

If Currenly Working (Boolean) is true; hide End Date field and clear any value from it.

Thanks,

Gerard

Posted in Flatpickr with "Present" value as well.

I am currently adding date ranges for jobs in my app. I want the user to pick the start and end dates using flatpickr gem. I also want the user to be able to set the field to "Present" if they are still working there. I was wondering what the best way to implement this would be.
See the screenshots from how LinkedIn do it.

[https://imgur.com/a/Jj1zoTL]

Thanks for your help guys.

Posted in Bootstrap class on individual tags in tag list

Hi Guys,
I am using the "acts as taggable on" gem and it's working perfectly. The issue I'm having is trying to style the individual tags in the list. I have the code below but it applys the pill style to the entire list rather than each tag. I have tried applying it to the "t" in the loop but its not working. Any help would be appriciated.

<%= raw article.tag_list.map { |t| link_to t, tag_path(t) }.join(', ') %>

here is what this is showing.

http://i65.tinypic.com/30bmz9w.png

Thanks for this explanation Umar, I will test it out and let you know how I get on.

Thanks,

Gerard

Hi Guys,
I have an artist model and I want users to be able to follow them without being followed back. Is there a gem that I can use to do this and is there any documentation on setting that up?

Thanks in advance for any advice.

Gerard

Posted in Symbols vs Strings Discussion

Great video Chris. Would love to see one on relationships such as has_many :through and Polymorphic.

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.