filestack / filestack-rails

Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
223 stars 102 forks source link

uninitialized constant FilestackRails::Version (NameError) when starting rails server #198

Closed kopchickm closed 5 years ago

kopchickm commented 5 years ago

Hi there,

After doing a bundle update filestack-rails from version 3.2.1 to 4.0.0, I now see the following error when starting rails server (I'm running rails 5.2.2 and ruby 2.4.4.):

/Users/username/.rvm/gems/ruby-2.4.4/gems/filestack-rails-4.0.0/app/helpers/filestack_rails/application_helper.rb:2:in `<top (required)>': uninitialized constant FilestackRails::Version (NameError)
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/filestack-rails-4.0.0/app/helpers/filestack_rails/form_helper.rb:3:in `<module:FormHelper>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/filestack-rails-4.0.0/app/helpers/filestack_rails/form_helper.rb:2:in `<module:FilestackRails>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/filestack-rails-4.0.0/app/helpers/filestack_rails/form_helper.rb:1:in `<top (required)>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/filestack-rails-4.0.0/lib/filestack_rails/engine.rb:13:in `block in <class:Engine>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `each'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `call'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
  from /Users/username/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
  from /Users/username/my_project/config/environment.rb:5:in `<top (required)>'
  from config.ru:3:in `require_relative'
  from config.ru:3:in `block in <main>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
  from config.ru:in `new'
  from config.ru:in `<main>'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:51:in `start'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
  from /Users/username/.rvm/gems/ruby-2.4.4/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<top (required)>'
  from bin/rails:9:in `require'
  from bin/rails:9:in `<main>'

Any ideas? Thanks!

kopchickm commented 5 years ago

Update: it looks like adding require "filestack_rails/version" to /lib/filestack-rails.rb fixes the problem.

gabifija commented 5 years ago

@kopchickm Thank you for your comments. I have already updated SDK, so it should work now.