Closed brancusi closed 7 years ago
Interesting I'm using it with rails 5 at the moment, and it seems to work fine, can you generate a small sample app which experiences this?
I will try to create one. Thank you
I am experiencing the same thing as well !! I try to run zeus generate and it gives that exact same error! Rails 5.1.0 ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]
Here is a link to a virgin project hehe :) https://github.com/staycreativedesign/zeus-error
Works in version 5.02 but not 5.1.0
Nice thanks so much @staycreativedesign that makes it much easier, I was actually working on a rails 5.0 app I realise. So thanks for that
same problem at rails 5.1.1
Related #569
I ran into a similar problem. Instead of console
I was trying to run server
. I did some digging and here's what I found:
The problem happens in https://github.com/burke/zeus/blob/master/rubygem/lib/zeus/rails.rb
at this method:
def server
require 'rails/commands/server'
server = ::Rails::Server.new
Dir.chdir(::Rails.application.root)
server.start
end
The Rails authors changed the commands directory structure (https://github.com/rails/rails/tree/master/railties/lib/rails/commands
). The path for the required file rails/commands/server
has been changed to rails/commands/server/server_command
.
I edited the method above to reflect this path change:
From: require 'rails/commands/server'
To: require 'rails/commands/server/server_command'
I ran Zeus and a new error appeared: uninitialized constant Rails::Command::Base
. I looked around and found the definition of this constant in rails/command
. So I inserted require 'rails/command'
at the beginning of the method.
I reran Zeus and a new error appeared; rack-2.0.3/lib/rack/server.rb:315:in `exist?': no implicit conversion of nil into String (TypeError)
.
I have no idea. It seems it has something to do with the injection of options and somehow the Rake task is not receiving those options. And it seems there has been a change in how the Rails server (and possibly the other tasks as well) are setup and invoked.
However, I found a way to make it work from the Rails initialization doc at http://guides.rubyonrails.org/initialization.html
.
def server
require 'rails/command'
::Rails::Command.invoke 'server', ARGV
end
I don't know if this is the right way to fix it. It's different from the original pattern. If you want to make the other commands work, you'll have to change the file path to the correct file path (among other things). For example, the method for the console
command will have to be changed to something like:
def console
require 'rails/command'
require 'rails/commands/console/console_command'
I hope this helps.
@server-monitor that helps a lot actually, I think this is very close to getting this fixed, sorry for the late response. Thanks so much for your investigation, if you like I'm very happy to accept a PR to fix that, I'm going to look into it as soon as I have some time to do so.
See the PR for a rather quick and dirty fix, if somebody likes to try it out that would be great I will built a package to try as soon as I have a Mac handy to build.
I pushed version 0.15.15.pre
to be installable via gem install --pre zeus
, make sure to first uninstall versions already on the system via gem uninstall zeus
and uninstall all versions including binaries to make sure there is no trouble around that. Would love if someone could try it out.
@sideshowcoder Worked like a charm. I didn't even have to uninstall.
ruby 2.4.1-p111
Rails 5.1.1
zeus 0.15.15.pre
fedora 25
Yeah for some reason I don't fully understand linux seems to normally be fine without uninstalling while MacOS seems to have trouble with 2 parallel versions of zeus being installed (sometimes). I see the same between my work mac and home ubuntu box. But great that it works @falonofthetower I will release as soon as I get more feedback than 👍
I ran into the same issue using the latest release of zeus with Rails 5.1 and the pre version of zeus is working great for me. Thanks!
Ran into the same issue and the 0.15.15.pre version fixed it. Perhaps it's time for an official release of that version?
Hi, after upgrading to rails 5, I can no longer run
zeus console
I get the following error:
Any ideas?