ruby-on-rails-6

rails 6 webpacker in production: rake assets:precompile fails

允我心安 提交于 2021-01-07 21:30:34
问题 I have a typical rails 6.0.2 app set up on a production server and I'm using git hooks to deploy the app. When I try to run: rails assets:precompile I get the following error: rake aborted! Sprockets::ArgumentError: link_directory argument must be a directory /home/user/myapp/app/assets/config/manifest.js:2 Here is the manifest.js file //= link_tree ../images //= link_directory ../stylesheets .css I cant figure out what Im doing wrong. Unless I'm mistaken, doesn't webpacker replace sprockets?

check_authorization causes custom devise controller to fail?

て烟熏妆下的殇ゞ 提交于 2021-01-07 02:52:34
问题 Background I have a simple app with devise and cancancan. Because I wanted to add a little bit of custom logic to the signup process, I used devise with customised controllers, which simply means devise uses the users controller (rather than devise controllers) for all of the things devise does. Problem When I add check_authorization to the application controller, and skip_authorization_check to all of the user (devise) controllers, I still get the following error raised when the user tries

check_authorization causes custom devise controller to fail?

冷暖自知 提交于 2021-01-07 02:51:41
问题 Background I have a simple app with devise and cancancan. Because I wanted to add a little bit of custom logic to the signup process, I used devise with customised controllers, which simply means devise uses the users controller (rather than devise controllers) for all of the things devise does. Problem When I add check_authorization to the application controller, and skip_authorization_check to all of the user (devise) controllers, I still get the following error raised when the user tries

Rails 6 + Capistrano - No such puma.sock file

試著忘記壹切 提交于 2021-01-05 07:24:41
问题 please, I have a giant problem for more than 10 hours. Whenever I run my application deployment in Rails, with Capistrano and Puma, and I run a restart of nginx, I see this error when I try to access my web: enter image description here When I access my nginx logs, I see the following error: 2020/12/29 04:09:50 [crit] 9536#9536: *73 connect() to unix:///home/ubuntu/apps/my_app/shared/tmp/sockets/my_app-puma.sock failed (2: No such file or directory) while connecting to upstream, client:

How to copy multiple lines of code into byebug?

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-27 05:59:25
问题 byebug doesn't seem to be able to handle multiple lines of code. Example I put byebug into the controller, and the next lines of code are (these could be anything, just an example here): payment_intent = Stripe::PaymentIntent.create({ payment_method_types: ['card'], amount: @amount_minor_unit, currency: @currency, application_fee_amount: 123, # STODO transfer_data: { destination: @star.stripe_account, }, }) But it does this: If the code is edited so it's on one single line, it succeeds:

How to copy multiple lines of code into byebug?

孤街醉人 提交于 2020-12-27 05:59:06
问题 byebug doesn't seem to be able to handle multiple lines of code. Example I put byebug into the controller, and the next lines of code are (these could be anything, just an example here): payment_intent = Stripe::PaymentIntent.create({ payment_method_types: ['card'], amount: @amount_minor_unit, currency: @currency, application_fee_amount: 123, # STODO transfer_data: { destination: @star.stripe_account, }, }) But it does this: If the code is edited so it's on one single line, it succeeds:

Rails 6 webpack throwing 'Uncaught ReferenceError: $ is not defined'

二次信任 提交于 2020-12-05 07:24:32
问题 Hi i recently started working on Rails 6 with ruby 2.6.5. as the rails 6 has introduced the webpacks so i am trying to load my js files with the webpack. Although i have already required the jquery in the appliation.js still i am getting the below error: 'Uncaught ReferenceError: $ is not defined' application.js require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") require('packs/jquery') My 'jquery.js' file is inside the packs

How to integrate JqTree in Rails 6 with webpacker, tree is not a function

喜你入骨 提交于 2020-12-04 08:22:18
问题 I am really wanting to know how to integrate jqTree as a webpacker webpack in my Rails 6 application UPDATE:- Using yarn add jqtree seems to have magically cleared up most of my issues however I am currently facing tree is not a function error I am using the Ancestry gem to organise menu items and I need a drag and drop javascript tree view solution that will work nicely with the Ancestry gem. I have picked on jqTree as my desired solutions but I am happy to be persuaded to use an alternative

How to integrate JqTree in Rails 6 with webpacker, tree is not a function

柔情痞子 提交于 2020-12-04 08:22:14
问题 I am really wanting to know how to integrate jqTree as a webpacker webpack in my Rails 6 application UPDATE:- Using yarn add jqtree seems to have magically cleared up most of my issues however I am currently facing tree is not a function error I am using the Ancestry gem to organise menu items and I need a drag and drop javascript tree view solution that will work nicely with the Ancestry gem. I have picked on jqTree as my desired solutions but I am happy to be persuaded to use an alternative

How to integrate JqTree in Rails 6 with webpacker, tree is not a function

最后都变了- 提交于 2020-12-04 08:22:06
问题 I am really wanting to know how to integrate jqTree as a webpacker webpack in my Rails 6 application UPDATE:- Using yarn add jqtree seems to have magically cleared up most of my issues however I am currently facing tree is not a function error I am using the Ancestry gem to organise menu items and I need a drag and drop javascript tree view solution that will work nicely with the Ancestry gem. I have picked on jqTree as my desired solutions but I am happy to be persuaded to use an alternative