Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deploy Sinatra and Puma (w/ mina-puma) #400

Closed
l0010o0001l opened this issue Jul 13, 2016 · 5 comments
Closed

Deploy Sinatra and Puma (w/ mina-puma) #400

l0010o0001l opened this issue Jul 13, 2016 · 5 comments

Comments

@l0010o0001l
Copy link

Hello! :)

I have been trying to start a Sinatra application that uses Puma. The files and directory structure successfully are placed in the remote server, however I can't seem to get Puma to start. I have tried various ways of passing in commands to the server with mina run, or queueing up a task to start it (using rackup -s Puma), or getting into the #{deploy_to}/#{current_directory} itself and trying to start it. The commonly returned error involves this stack trace:

Puma starting in single mode...
* Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
* Min threads: 0, max threads: 16
* Environment: development
! Unable to load application: NoMethodError: undefined method `set_default' for main:Object
Did you mean?  set_trace_func
/srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-0.3.8/lib/mina/bundler.rb:12:in `<top (required)>': undefined method `set_default' for main:Object (NoMethodError)
Did you mean?  set_trace_func
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma/tasks.rake:1:in `require'
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma/tasks.rake:1:in `<top (required)>'
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma.rb:1:in `load'
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma.rb:1:in `<top (required)>'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `require'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `rescue in block in require'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:77:in `block in require'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
    from /srv/deploy_user/crazy_application/releases/10/boot.rb:4:in `<top (required)>'
    from config.ru:1:in `require_relative'
    from config.ru:1:in `block in <main>'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:184:in `instance_eval'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:184:in `initialize'
    from config.ru:in `new'
    from config.ru:in `<main>'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:170:in `eval'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:170:in `new_from_string'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:161:in `parse_file'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/configuration.rb:313:in `load_rackup'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/configuration.rb:242:in `app'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/runner.rb:123:in `load_and_bind'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/single.rb:84:in `run'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/launcher.rb:172:in `run'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/cli.rb:74:in `run'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/bin/puma:10:in `<top (required)>'
    from /opt/rubies/ruby-2.3.0/bin/puma:23:in `load'
    from /opt/rubies/ruby-2.3.0/bin/puma:23:in `<main>'

Any help is supremely appreciated in advance.

@d4be4st
Copy link
Member

d4be4st commented Jul 14, 2016

In your gemfile add require: false to mina and its plugins:

gem 'mina', require: false

On Thu, Jul 14, 2016, 01:54 Tara Planas notifications@github.com wrote:

Hello! :)

I have been trying to start a Sinatra application that uses Puma. The
files and directory structure successfully are placed in the remote server,
however I can't seem to get Puma to start. I have tried various ways of
passing in commands to the server with mina run, or queueing up a task to
start it (using rackup -s Puma), or getting into the
#{deploy_to}/#{current_directory} itself and trying to start it. The
commonly returned error involves this stack trace:

Puma starting in single mode...

  • Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
  • Min threads: 0, max threads: 16
  • Environment: development
    ! Unable to load application: NoMethodError: undefined method set_default' for main:Object Did you mean? set_trace_func /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-0.3.8/lib/mina/bundler.rb:12:in<top (required)>': undefined method set_default' for main:Object (NoMethodError) Did you mean? set_trace_func from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma/tasks.rake:1:inrequire'
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma/tasks.rake:1:in <top (required)>' from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma.rb:1:inload'
    from /srv/deploy_user/crazy_application/releases/10/vendor/bundle/ruby/2.3.0/gems/mina-puma-0.3.1/lib/mina/puma.rb:1:in <top (required)>' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:inrequire'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in rescue in block in require' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:77:inblock in require'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in each' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:inrequire'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in require' from /srv/deploy_user/crazy_application/releases/10/boot.rb:4:in<top (required)>'
    from config.ru:1:in require_relative' from config.ru:1:inblock in '
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:184:in instance_eval' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:184:ininitialize'
    from config.ru:in new' from config.ru:in'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:170:in eval' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:170:innew_from_string'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/rack/builder.rb:161:in parse_file' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/configuration.rb:313:inload_rackup'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/configuration.rb:242:in app' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/runner.rb:123:inload_and_bind'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/single.rb:84:in run' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/launcher.rb:172:inrun'
    from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/lib/puma/cli.rb:74:in run' from /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.4.0/bin/puma:10:in<top (required)>'
    from /opt/rubies/ruby-2.3.0/bin/puma:23:in load' from /opt/rubies/ruby-2.3.0/bin/puma:23:in'

Any help is supremely appreciated in advance.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#400, or mute the thread
https://github.com/notifications/unsubscribe/AA7cMGOE7Dzh3CF7xpJ1pbvYOW2ZVJPIks5qVXqwgaJpZM4JL9g6
.

@l0010o0001l
Copy link
Author

@d4be4st Thank you! That works! 💃

@l0010o0001l
Copy link
Author

Sorry to bring this up again, but I was wondering if you had any ideas about using this gem as a dependency in another gem; would you specify that it is a runtime dependency, or a development dependency? Basically, I currently have it as a runtime dependency in the gemspec, and am requiring it, for example, require: mina/bundler in a .rb file... and am hitting the following in several ways:

NoMethodError: undefined method `set_default' for main:Object
Did you mean?  set_trace_func
  /Users/l0010o0001l/.gem/ruby/2.3.0/gems/mina-0.3.8/lib/mina/bundler.rb:12:in `<top (required)>'

Many thanks in advance for any pointers! ☝️

@d4be4st
Copy link
Member

d4be4st commented Jul 27, 2016

Hi @l0010o0001l.

Mina isn't supposed to be a runtime dependancy. It is a separate CLI tool for deployement. You can put it in your gemfile but only as a 'note' for your future self that you are using mina as a deployment tool.

If you still want to put mina in your gemfile best fix is just to add require: false:

gem 'mina', require: false

@inyerade
Copy link

inyerade commented Jul 16, 2018

Hi @l0010o0001l , can you post your deploy and setup task? I want use mina to deploy a sinatra app but I do not so shure of deploy task

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants