1

I cannot start the server after adding the gem "acts as xlsx" to my gemfile.

I have read other posts on this problem but still haven't got a clue what is going on. Most seem to have resolved the problem by removing the gem from the gemfile. If I remove the gem, I can start the server but I need it to do what I want to do. Also, I get the same message if I use the gem "axlsx" or "axlsx_rails", so I believe that something that is required in this gem is creating this issue.

The error message is

"bin/rails:6: warning: already initialized constant APP_PATH /home/ubuntu/workspace/horsestud_app/bin/rails:6: warning: previous definition of APP_PATH was here
Error: Command '-b' not recognized"

Thanking you in advance...

user3331154
  • 177
  • 1
  • 11
  • Are you sure that this is an issue with the gem? Does removing the gem fix the issue? – Anthony E May 08 '16 at 02:14
  • Do the instructions in [rails server bin/rails:6: warning: already initialized constant APP_PATH error](http://stackoverflow.com/questions/23402820/rails-server-bin-rails6-warning-already-initialized-constant-app-path-error) help at all? What have you tried so far? – Michael Gaskill May 08 '16 at 03:52
  • Thank you both for your questions. 1. Removing the gem does fix the issue, and 2. I have researched the warning - "already initialized constant APP_Path...." and it does seem that most have to do with a gem causing the issue and removal of the gem resolves it. Not a good solution, I would think, if you need or want the gem! Would love to resolve this! – user3331154 May 15 '16 at 01:20
  • Note: Also fails at a lower level with just the axlsx gem in the gemfile – user3331154 May 15 '16 at 03:32

1 Answers1

0

This is the answer I got from posting this as well on axlsx_rails/issues.

"

You've ended up with axlsx 1.3.6 because you added acts_as_xlsx first. You'll want at least this in your Gemfile:

gem 'rubyzip', '= 1.0.0' gem 'axlsx', '= 2.0.1' gem 'axlsx_rails'

You could also use the github repo for axlsx. Another zip option is gem 'zip-zip'.

The acts_as_xlsx gem is not compatible with Rails 4 or above (if I remember correctly.) You'll want to use my version of the acts_ax_xlsx repo: https://github.com/straydogstudio/acts_as_xlsx.

Let me know how it goes."

This worked for me. Thanks again straydogstudio!

user3331154
  • 177
  • 1
  • 11