ruby-on-rails-6

Issue when installing rails apartment gem

拥有回忆 提交于 2020-08-08 06:34:17
问题 I am getting an error when I am trying to bundle exec rails generate apartment:install Getting this error, build': undefined method new' for "Apartment::Reloader":String (NoMethodError) Looks this is a middleware issue. Any solution. 回答1: In order to use Rails 6 you have to use the development branch on github: gem "apartment", git: 'git@github.com:influitive/apartment.git', branch: "development" 来源: https://stackoverflow.com/questions/59590162/issue-when-installing-rails-apartment-gem

RAILS 6 - how to use EasyAutocomplete

こ雲淡風輕ζ 提交于 2020-08-08 05:48:09
问题 I try the last hours to integrate EasyAutocomplete into RAILS 6. But not so easy. What I did : Install Javascript Package with yarn: # yarn add easy-autocomplete Add this in the file app/javascript/packs/application.js import “easy-autocomplete” Add this in the file app/assets/stylesheets/application.css *= require easy-autocomplete *= require easy-autocomplete.themes Then start the Rails Server and refresh the Web Page. Then try to use it. Go into the developer console and type : var options

Rails 6+, zeitwerk autoloader and namedspaced constants

久未见 提交于 2020-06-16 03:44:26
问题 The Rails 6+ default autoloader is zeitwerk, which seems like a great improvement over previous approaches. However, zeitwork follows the convention for Rails projects that anything in app/* is autoloaded and doesn't need to be namespaced. This works great for app/models/user.rb because you don't have to use Models::User but can just reference User . However, I added my own app/services directory and I namespace my service objects as Services::Users::Create , which would map to app/services

I moved my folder from lib to /app in a rails 6, I can't seem to instantiate an object still because of load path issue

北慕城南 提交于 2020-06-01 07:15:05
问题 I have a new rails 6 application and in the lib folder I had this: /lib/some_app_name/stripe/subscription/subscription_service.rb module Someappname # Someappname is also in my application.rb module Stripe class SubscriptionService def initialize(a) @a = a end end end end I then moved the 'some_app_name' folder to: /app/some_app_name/stripe/subscription_service.rb I read that anything inside of /app will be autoloaded and reloaded so I moved in here. It wasn't working in /lib also. In my home

Install Glide.js in Rails 6 with Webpack

北战南征 提交于 2020-05-28 04:29:27
问题 I created a new Rails 6 project and I'm trying to install the third party javascript library Glide.js via Webpack. However, it seems like I'm missing a crucial step because it's not working. What I've done so far: Install Glide.js with yarn: yarn add @glidejs/glide Require Glide.js in /app/javascript/packs/application.js : require("jquery") require("@glidejs/glide") require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") import

Deploy to Heroku failed. move-file incompatible with node version

萝らか妹 提交于 2020-05-17 07:46:08
问题 I am struggling to deploy a new rails 6 app to heroku. It runs fine on my local. During the deployment process I receive the following output. Unfortunately, I am new to webpack and yarn. It seems like a version / dependency issue with move-file which in turn seems to be a dependency for webpacker. However, I have no idea how to resolve this. It seems to come down to this line: error move-file@2.0.0: The engine "node" is incompatible with this module. Expected version ">=10.17". Got "10.15.3"