Juan S. Caro

Joined

1,460 Experience
3 Lessons Completed
1 Question Solved

Activity

It is the fifth time I try from scratch the deployment and have had deployed previously without any major problem. Think is, I don't know if it because now default repositories submit passenger 6, but I can find a way to get the app in passenger working. When I deploy with capistrano, It always fails in the point of restarting passenger:

05:16 passenger:restart
01 passenger-config restart-app /home/deploy/redvies --ignore-app-not-running
01 *** ERROR: Phusion Passenger(R) doesn't seem to be running. If you are sure that it
01 is running, then the causes of this problem could be one of:
01
01 1. You customized the instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's
01 passenger_instance_registry_dir option, or Phusion Passenger(R) Standalone's
01 --instance-registry-dir command line argument. If so, please set the
01 environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
01 and run this command again.
01 2. The instance directory has been removed by an operating system background
01 service. Please set a different instance registry directory using Apache's
01 PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
01 option, or Phusion Passenger(R) Standalone's --instance-registry-dir command
01 line argument.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@80.240.127.15: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger(R) doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of...

Passenger status says everything is alright, but again, no app is running. I have triple check everything, but it seems something has changed. Any idea?

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

I think it is not OK to have a guide with lastest versions that is autogenerated to rank well in SEO keywords but that actually isn't updated as it is and can't be used without problems. Repos, passenger, node there are a lot of problematic parts.

Posted in How to Deploy Rails to Fly.io Discussion

Hi Chris! It would be also great to have an update on guides for deploying into VPS with Caddy intead of NGINX. Just forgetting about certs make it easier yet.

Thanks!

Posted in How to use jQuery & jQueryUI with Esbuild Discussion

I have the same thought. Everything was easier before javascript took our world

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

I have used for recent installation with ubuntu 20.04 and ruby 2.6.6

at some point nginx get unresolved dependencies, and you have to get a new repo:

deb https://oss-binaries.phusionpassenger.com/apt/passenger focal main

in the end the problem is phusion passenger doesn't start automatically. How can I fix that?

Posted in Introduction to Stimulus Reflex Discussion

This is giving rails a new whole lifespan. Love it.

Posted in Multiple Users with Devise

Hi Chris!

How would you model those profiles?
I understand that is an optional extension, but I'm not sure yet how to shape that concept. An additional model?

In my case every profile has a different set of attributes, and getting all of them in the same model would be a mess. What would be the proper way?

Me too. I prefer Stimulus over all other options. Is the Rails way. So easy and useful.

Hi, I have been thinking about that since a few Days ago. I don't know which is more efficient and how much, and also how easy/hard could be the migration from one to the other. Any experience/insight here?

Posted in Webpack assets doesn't work after deployment

Thanks again. I really appreciate your help and the help of the community.

Posted in Webpack assets doesn't work after deployment

Thank you for the help, Chris.

It was weird, because I did that, and at times worked and everything loaded fine, and some others don't. I couldn't find specific patters.

I have found a solution that works consistently now, and was adding

set :linked_dirs, fetch(:linked_dirs, []).push('public/packs', 'node_modules')

to config/deploy.rb

Not sure if I was a victim of a very specific case, or did something wrong in the past, but can't understand fully the issue.

Posted in Webpack assets doesn't work after deployment

I made it work again manually (without fixing the problem) by doing:

  1. Yarn upgrade in the server
  2. Entering in the current folder, and executing 'RAILS_ENV=production bundle exec rake webpacker:compile'
  3. Then compiles, and I could see the files in the latest release but I didn't correspond with ones in the folder current.
  4. Then, I did reboot, and it worked.

Could it be that Capistrano is missing something?
Could it be that Capistrano need a reboot to apply some changes in JS? (contents are applied instanly)

Posted in Webpack assets doesn't work after deployment

There is not such file in the disk:

Error and file missing

The this is, I'm not sure what to conclude. Was the compilation still a success intead there is no file there?

Posted in Webpack assets doesn't work after deployment

Please, check again the JS error link. I fix it.

I'm including pack in the layout including this line between < head > and < /head >:

<%= javascript_pack_tag 'application' %>

in the application.html.erb

Posted in Webpack assets doesn't work after deployment

Sorry, I don't know what happened with the format.

This is the capistrano log:

http://www.adeter.org/capistrano.log

and this is the error showed in the browser's inspector:

JS error

Thanks

Posted in Webpack assets doesn't work after deployment

The error in the inspector is:

Loading failed for the with source “<a href="https://www.guiallerena.es/packs/application-60e1bbc8f51fd696bd2b.js%E2%80%9D" target="_blank" rel="noopener noreferrer nofollow">https://www.guiallerena.es/packs/application-60e1bbc8f51fd696bd2b.js”</a>.</p> <p>** The capistrano deployment said: **</p> <p>yarn:install<br> 01 yarn install --production<br> 01 yarn install v1.12.3<br> 01 warning package.json: No license field<br> 01 warning No license field<br> 01 [1/4] Resolving packages...<br> 01 [2/4] Fetching packages...<br> 01 info <a href="mailto:fsevents@1.2.7" target="_blank" rel="noopener noreferrer nofollow">fsevents@1.2.7</a>: The platform &quot;linux&quot; is incompatible with this module.<br> 01 info &quot;<a href="mailto:fsevents@1.2.7" target="_blank" rel="noopener noreferrer nofollow">fsevents@1.2.7</a>&quot; is an optional dependency and failed compatibility check. Excluding it from installation.<br> 01 [3/4] Linking dependencies...<br> 01 warning &quot;@rails/webpacker &gt; <a href="mailto:postcss-cssnext@3.1.0" target="_blank" rel="noopener noreferrer nofollow">postcss-cssnext@3.1.0</a>&quot; has unmet peer dependency &quot;caniuse-lite@<sup>1.0.30000697&quot;.</sup><br> 01 warning &quot; &gt; <a href="mailto:webpack-dev-server@2.11.2" target="_blank" rel="noopener noreferrer nofollow">webpack-dev-server@2.11.2</a>&quot; has unmet peer dependency &quot;webpack@<sup>2.2.0</sup> || <sup>3.0.0&quot;.</sup><br> 01 warning &quot;webpack-dev-server &gt; <a href="mailto:webpack-dev-middleware@1.12.2" target="_blank" rel="noopener noreferrer nofollow">webpack-dev-middleware@1.12.2</a>&quot; has unmet peer dependency &quot;webpack@<sup>1.0.0</sup> || <sup>2.0.0</sup> || <sup>…</sup><br> 01 [4/4] Building fresh packages...<br> 01 Done in 24.61s.<br> ✔ 01 <a href="mailto:deploy@51.254.129.78" target="_blank" rel="noopener noreferrer nofollow">deploy@51.254.129.78</a> 25.239s<br> 01:00 deploy:assets:precompile<br> 01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile<br> 01 [fog][DEPRECATION] Unable to load Fog::Atmos::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::Atmos is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Clodo::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Clodo is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::DigitalOcean::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::DigitalOcean is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Dnsimple::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Dnsimple is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::DNSMadeEasy::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::DNSMadeEasy is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Fogdocker::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Fogdocker is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Dreamhost::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Dreamhost is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Dynect::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Dynect is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Ecloud::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Ecloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Glesys::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Glesys is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::GoGrid::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::GoGrid is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Google::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Google is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Google::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Google is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Google::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::Google is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::IBM::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::IBM is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::IBM::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::IBM is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::InternetArchive::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::InternetArchive is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Linode::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Linode is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Linode::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Linode is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::BareMetalCloud::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::BareMetalCloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::CDN<br> 01 [fog][DEPRECATION] The format Fog::CDN::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::CDN v2<br> 01 [fog][DEPRECATION] The format Fog::CDN v2::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::Compute v2<br> 01 [fog][DEPRECATION] The format Fog::Compute v2::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rackspace::Databases<br> 01 [fog][DEPRECATION] The format Fog::Databases::Rackspace is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Rage4::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Rage4 is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::PowerDNS::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::PowerDNS is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::ProfitBricks::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::ProfitBricks is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::SakuraCloud::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::SakuraCloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::SakuraCloud::Volume<br> 01 [fog][DEPRECATION] The format Fog::Volume::SakuraCloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::SakuraCloud::Network<br> 01 [fog][DEPRECATION] The format Fog::Network::SakuraCloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::SakuraCloud::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::SakuraCloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Serverlove::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Serverlove is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Softlayer::Account<br> 01 [fog][DEPRECATION] The format Fog::Account::Softlayer is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Softlayer::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Softlayer is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Softlayer::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::Softlayer is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Softlayer::Network<br> 01 [fog][DEPRECATION] The format Fog::Network::Softlayer is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Softlayer::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::Softlayer is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Network<br> 01 [fog][DEPRECATION] The format Fog::Network::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::DNS<br> 01 [fog][DEPRECATION] The format Fog::DNS::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Billing<br> 01 [fog][DEPRECATION] The format Fog::Billing::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Monitoring<br> 01 [fog][DEPRECATION] The format Fog::Monitoring::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Support<br> 01 [fog][DEPRECATION] The format Fog::Support::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::Account<br> 01 [fog][DEPRECATION] The format Fog::Account::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::StormOnDemand::VPN<br> 01 [fog][DEPRECATION] The format Fog::VPN::StormOnDemand is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Vcloud::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Vcloud is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::VcloudDirector::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::VcloudDirector is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Vmfusion::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Vmfusion is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Voxel::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Voxel is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::CloudSigma::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::CloudSigma is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Openvz::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Openvz is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::OpenNebula::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::OpenNebula is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Aliyun::Compute<br> 01 [fog][DEPRECATION] The format Fog::Compute::Aliyun is deprecated<br> 01 [fog][DEPRECATION] Unable to load Fog::Aliyun::Storage<br> 01 [fog][DEPRECATION] The format Fog::Storage::Aliyun is deprecated<br> 01 I, [2019-08-05T19:00:50.659805 #9007] INFO -- : Writing /home/deploy/guialocal/releases/20190805165929/public/assets…<br> 01 I, [2019-08-05T19:00:50.661770 #9007] INFO -- : Writing /home/deploy/guialocal/releases/20190805165929/public/assets…<br> 01 I, [2019-08-05T19:00:56.458360 #9007] INFO -- : Writing /home/deploy/guialocal/releases/20190805165929/public/assets…<br> 01 I, [2019-08-05T19:00:56.459467 #9007] INFO -- : Writing /home/deploy/guialocal/releases/20190805165929/public/assets…<br> ✔ 01 <a href="mailto:deploy@51.254.129.78" target="_blank" rel="noopener noreferrer nofollow">deploy@51.254.129.78</a> 31.905s<br> 01:33 deploy:assets:backup_manifest<br> 01 mkdir -p /home/deploy/guialocal/releases/20190805165929/assets_manifest_backup<br> ✔ 01 <a href="mailto:deploy@51.254.129.78" target="_blank" rel="noopener noreferrer nofollow">deploy@51.254.129.78</a> 0.329s<br> 02 cp /home/deploy/guialocal/releases/20190805165929/public/assets/.sprockets-manifest-306a4968608c35e5f7fec8ef7c2a7a3e.…<br> ✔ 02 <a href="mailto:deploy@51.254.129.78" target="_blank" rel="noopener noreferrer nofollow">deploy@51.254.129.78</a> 0.181s</p>

Posted in Webpack assets doesn't work after deployment

The error is that the files on the folder webpack are not found. In consequence none of the javascript components are loaded. I have checked yarn is installed in the server.

I have read that there is a couple of gems:

  • capistrano-yarn and capistrano nvm that may help, but just don't want to mess the project installing stuff that I don't know and without knowing what I pursuit.

On the other hand, in config/deploy.rb there is:

# Default value for linked_dirs is []
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system", "public/uploads"

in which isn't include app/javascript/packs.

I don't know if this might be the problem.

Posted in Webpack assets doesn't work after deployment

Hi, I have been using happily rails until I decided to try stimulusJS. In the begining was great. I saw great value using it. The thing is the assets in the pack folder are not compiled when doing "cap production deploy".

Is there something I should do after trying webpack to get all that assets compiled?

Thanks

PD: Since I started my main project with Rails 5.0, I did use the deplyment guide of this page.

Posted in Server Administration with Cockpit Discussion

This is really amazing. I really hoped for this episode. Thanks.

Posted in Security Hardening Servers with Fail2Ban Discussion

Great episode Chris!

I was really missing more videos about managing your own sercer in the day to day with all these useful things.

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

© 2023 GoRails, LLC. All rights reserved.