betterment / demo_mode Goto Github PK
View Code? Open in Web Editor NEWA configurable demo mode for your Rails app. Specify your desired "personas" and Demo Mode will handle the rest.
License: MIT License
A configurable demo mode for your Rails app. Specify your desired "personas" and Demo Mode will handle the rest.
License: MIT License
I'm trying to set up demo_mode in a new Rails app (tried with an older one as well, but same issue).
Running it on a Rails 7 app with Ruby 3.0.3.
What I'm getting is a failure with the rake task.
bundle exec rails generate demo_mode:install
create config/initializers/demo_mode.rb
create config/personas/sample_persona.rb
rake demo_mode:install:migrations
rake aborted!
Don't know how to build task 'demo_mode:install:migrations' (See the list of available tasks with `rake --tasks`)
And running it with --trace:
rake demo_mode:install:migrations --trace
rake aborted!
Don't know how to build task 'demo_mode:install:migrations' (See the list of available tasks with `rake --tasks`)
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/task_manager.rb:59:in `[]'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:159:in `invoke_task'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/home/daniel/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/daniel/.rbenv/versions/3.0.3/bin/rake:25:in `load'
/home/daniel/.rbenv/versions/3.0.3/bin/rake:25:in `<main>'
Thank you in advance! Demo_mode looks amazing!
When running the installer, I ran into issues where the installer expected Sprockets:
/var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/sprockets-rails-3.5.1/lib/sprockets/railtie.rb:106:in `block in <class:Railtie>': Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
But did not, please create this file and use it to link any assets that need
to be rendered by your app:
Example:
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
and restart your server
For more information see: https://github.com/rails/sprockets/blob/070fc01947c111d35bb4c836e9bb71962a8e0595/UPGRADING.md#manifestjs
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/initializable.rb:32:in `instance_exec'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/initializable.rb:32:in `run'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/initializable.rb:61:in `block in run_initializers'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:231:in `block in tsort_each'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:353:in `block (2 levels) in each_strongly_connected_component'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:434:in `each_strongly_connected_component_from'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:352:in `block in each_strongly_connected_component'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `each'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `call'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:350:in `each_strongly_connected_component'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:229:in `tsort_each'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/tsort.rb:208:in `tsort_each'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/initializable.rb:60:in `run_initializers'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/application.rb:426:in `initialize!'
from /var/home/reesericci/Code/united/config/environment.rb:5:in `<main>'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/application.rb:402:in `require_environment!'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command/actions.rb:20:in `boot_application!'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/commands/generate/generate_command.rb:21:in `perform'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command/base.rb:178:in `invoke_command'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command/base.rb:73:in `perform'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command.rb:71:in `block in invoke'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command.rb:149:in `with_argv'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/command.rb:69:in `invoke'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/bundler/gems/rails-82054e8eb76a/railties/lib/rails/commands.rb:18:in `<main>'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
from /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from bin/rails:4:in `<main>'
/var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30: warning: /var/home/reesericci/.rbenv/versions/3.3.2/lib/ruby/3.3.0/csv.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of spreadsheet_architect-5.0.0 to add csv into its gemspec.
bin/rails aborted!
Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
But did not, please create this file and use it to link any assets that need
to be rendered by your app:
Example:
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
and restart your server
For more information see: https://github.com/rails/sprockets/blob/070fc01947c111d35bb4c836e9bb71962a8e0595/UPGRADING.md#manifestjs
/var/home/reesericci/Code/united/config/environment.rb:5:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
✘ reesericci@toolbox ~/Code/united main ●
It would be nice to be able to def
up some helper methods inside the add_persona
block that are callable from within sign_in_as
but don't pollute any global namespaces (at the least to avoid naming conflicts).
When running with demo mode enabled in local development, running rake db:reset
will clear out any existing DemoMode::Session
record. This can cause the application to break due to an ActiveRecord::RecordNotFound
error triggered by one of the controller before_action
s. Instead of raising a hard error, we could probably force a logout instead. We'd just need to think about whether this wouldn't mask real lookup issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.