madzhuga / rails_workflow

Check Wiki for details
MIT License
323 stars 41 forks source link

rails generate rails_workflow:install fails #42

Closed ggeron closed 5 years ago

ggeron commented 5 years ago

Hi, I cant get the rails_workflow gem to install, can you please advise? I tried with both rails 5.1.4 & 5.2.3

Many thanks in advance! G

error message:

/Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:90: warning: already initialized constant FileUtils::VERSION /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils/version.rb:4: warning: previous definition of VERSION was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1188: warning: already initialized constant FileUtils::Entry_::S_IF_DOOR /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1267: warning: previous definition of S_IFDOOR was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1446: warning: already initialized constant FileUtils::Entry::DIRECTORY_TERM /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1547: warning: previous definition of DIRECTORYTERM was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1448: warning: already initialized constant FileUtils::Entry::SYSCASE /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1549: warning: previous definition of SYSCASE was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1501: warning: already initialized constant FileUtils::OPT_TABLE /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1602: warning: previous definition of OPT_TABLE was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1555: warning: already initialized constant FileUtils::LOW_METHODS /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1656: warning: previous definition of LOW_METHODS was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/fileutils.rb:1562: warning: already initialized constant FileUtils::METHODS /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fileutils-1.2.0/lib/fileutils.rb:1663: warning: previous definition of METHODS was here /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/railtie/configuration.rb:97:in method_missing': undefined methodassets' for # Did you mean? asset_host (NoMethodError) from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rails_workflow-0.7.3/lib/rails_workflow/engine.rb:22:in block in <class:Engine>' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:ininstance_exec' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in run' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:inblock in run_initializers' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:228:in block in tsort_each' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:431:in each_strongly_connected_component_from' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:349:inblock in each_strongly_connected_component' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:in each' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:incall' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:in each_strongly_connected_component' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:226:intsort_each' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:205:in tsort_each' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:inrun_initializers' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in initialize!' from /Users/guest/workspace/workflowapp/config/environment.rb:5:in<top (required)>' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:inblock in require' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in load_dependency' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:inrequire' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:102:in preload' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:153:inserve' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in block in run' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:inloop' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in run' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in<top (required)>' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in require' from /Users/guest/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from -e:1:in `

'

Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
#gem 'rails', '5.1.4'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

#rails workflow
gem 'rails_workflow'
gem 'active_model_serializers'
gem 'activejob'
gem 'bootstrap-rails-engine'
gem 'draper'
gem 'guid'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'slim-rails'
gem 'will_paginate'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of chromedriver to run system tests with Chrome
  gem 'chromedriver-helper'
  #workflow
  gem 'devise'
  gem 'rails-controller-testing'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
ggeron commented 5 years ago

seems like the issue is to do with webpacker

cdesch commented 5 years ago

@ggeron were you able to get this to work? I don't suspect it will work with Rails 6 then.

madzhuga commented 5 years ago

I just created new blank rails 5.2.3 application, added devise and installed rails workflow. rails generate rails_workflow:install worked just fine. This command creates new migration for wf models. I had to open this migration and replace

class CreateWorkflowProcesses < ActiveRecord::Migration

with class CreateWorkflowProcesses < ActiveRecord::Migration[4.2] It required me to specify a version. After that migration passed.

I've added Rails 5 support for this gem in past andnow I am working on specific non-open source version which customized a lot and I am not sure if there are any issues with Rails 5.2+ versions in it now.