katon icon indicating copy to clipboard operation
katon copied to clipboard

Rails: Command '--port' not recognized

Open axelson opened this issue 10 years ago • 9 comments

Everything was working great until I tried katon reload, although I'm not positive that's what caused it. I am using katon 0.9.1 and added my server using: katon add 'rails server --port $PORT'

I'm unable to access my 'proj.ka' site and when running katon log I see:

[katon] Starting admin on port: 31030 using command: rails server --port 31030
bin/rails:6: warning: already initialized constant APP_PATH
/Users/jason/proj/bin/rails:6: warning: previous definition of APP_PATH was here
Error: Command '--port' not recognized
Usage: rails COMMAND [ARGS]

So maybe katon isn't running rails server --port 31030 directly? Since that command works fine in the terminal.

I'm using rails 4.1.7 and rbenv 0.4.0 if that matters.

axelson avatar Mar 05 '15 00:03 axelson

Could you maybe try to run katon rm and then katon add 'rails server --port $PORT, and tell me if it works again?

I suspect katon reload to maybe create another process too quickly.

I'll do some tests tomorrow as well.

typicode avatar Mar 05 '15 04:03 typicode

Re-adding the server resulted in the same exact behavior. Upgrading to katon 0.10.0 didn't help either. But narrowed it down to only occur when I include the mysql2 gem, even if I'm not including that in database.yml or anything. Seems odd. Using ruby 2.1.5 and mysql2 0.3.18 (also tried 0.3.17)

axelson avatar Mar 05 '15 21:03 axelson

I've tried with rails 4.1.7 but no errors. I'll try to add mysql gem. If you run $ rails server do you get the error or is it only when you use it with katon?

typicode avatar Mar 07 '15 11:03 typicode

Can you try this rails repo? For me the first commit works fine and is just a typical rails project, but the second commit that just adds mysql2 fails. However rails server works fine.

https://github.com/axelson/katontest

axelson avatar Mar 08 '15 00:03 axelson

Sure, thanks for setting it up! I'll be a little busy so don't know when I'll have time.

typicode avatar Mar 08 '15 19:03 typicode

Okay, thanks. For now I guess I'll just have to run rails server directly.

On Sun, Mar 8, 2015 at 9:46 AM typicode [email protected] wrote:

Sure, thanks for setting it up! I'll be a little busy so don't know when I'll have time.

— Reply to this email directly or view it on GitHub https://github.com/typicode/katon/issues/64#issuecomment-77770160.

axelson avatar Mar 09 '15 18:03 axelson

Hi, so I've done some tests with your repo and it seems like that I get the error only when mysql is not installed.

Can you try running brew install mysql?

typicode avatar Mar 16 '15 18:03 typicode

That would probably fix it, but I don't understand why it matters how MySQL is installed? I have it installed "natively" (i.e. via the official package)

http://dev.mysql.com/doc/mysql-macosx-excerpt/5.5/en/macosx-installation-pkg.html

I believe that installing mysql via homebrew would conflict with my current installation.

axelson avatar Mar 16 '15 21:03 axelson

I agree that's weird and don't know either why it makes a difference. Personally, I always use brew to install everything.

I'll try to make some more tests, if you find the reason behind it I'll be happy to know.

typicode avatar Mar 16 '15 21:03 typicode