1

Sinatra launches immediately after exiting rails-console:

$ rails c
Loading development environment (Rails 3.1.11)
[1] pry(main)> exit
[2014-02-06 14:01:50] INFO  WEBrick 1.3.1
[2014-02-06 14:01:50] INFO  ruby 1.9.3 (2014-01-09) [java]
== Sinatra/1.3.3 has taken the stage on 4567 for development with backup from WEBrick
[2014-02-06 14:01:50] INFO  WEBrick::HTTPServer#start: pid=4516 port=4567

The problem occurs when irb is used as the rails-console repl as well.

The problem does not occur when rails exits, only when rails console exits.

The problem occurs using jruby-1.7.10 but not jruby-1.6.7. The problem was originally noticed after upgrading.

Sinatra is available elsewhere in my stack (so it starting is not completely out of left field) but why does it start when rails-console exits.

A temporary fix to this is the following steps:

  1. remove gem 'sinatra' from the Gemfile
  2. run $ bundle install
  3. add gem 'sinatra' back to the Gemfile
  4. run $ bundle install

Unfortunately, after a few modifications to the to Gemfile and another bundle install the issue persists. I imagine this a bug in bundler, but of all things to happen why would a sintra server launch?

rudolph9
  • 8,021
  • 9
  • 50
  • 80
  • It's not a bug it's a feature! – DiegoSalazar Feb 06 '14 at 20:29
  • @diego.greyrobot how do I disable that feature? – rudolph9 Feb 06 '14 at 22:03
  • 1
    Ok all joking aside, I have no idea. I'd say you have some line of code somewhere that is causing this. Maybe in a *rc file or a rake file. By *rc file I mean something like .irbrc etc. Also, try searching your project directory for that line of code, there's only a few ways to launch the sinatra process i.e. calling ruby my_sinatra_file.rb. Figure out which file it is first and then grep for that line in your project. – DiegoSalazar Feb 06 '14 at 22:40

1 Answers1

0

We had the same problem. We solved it by changing our Gemfile like this:

gem 'sinatra', require: false

More info about what this does can be found in: Bundler: What does :require => false in a Gemfile mean?

Community
  • 1
  • 1
vas
  • 810
  • 8
  • 10