Starting thin server without the thin gem does not work
Asked Answered
C

3

9

I am using ruby 1.9.3 and rails 3.2.2. Every time i use the thin server with private_pub gem it does not work i did rackup private_pub.ru -s thin -E production. I get the following error

/home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `block in get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `load'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `<main>'
rzaartz@ubuntu:~/paper$ rvm 1.9.3
rzaartz@ubuntu:~/paper$ rackup private_pub.ru -s thin -E production
/home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `block in get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `load'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `<main>'

but it i include the thin gem in my gem file it would work fine. Any help thanks.

Ceratodus answered 5/3, 2012 at 19:40 Comment(0)
E
21

You can't start linux without linux.

You can't launch a rackup server without Rack.

You can't launch thin without thin gem.

Electrophoresis answered 5/3, 2012 at 20:0 Comment(6)
i checked a tutorial by ryan bates and in his source code he did not include the thin gemCeratodus
but he had thin install on this gem repositoryElectrophoresis
rackup -rubygems private_pub.ru -s thin -E production and you need stop using BundlerElectrophoresis
still no luck unless i add the thin gem in my gem fileCeratodus
@UchennaOkafor Then just add it to the Gemfile! Why are you trying to complicate things that are straight forward?Hannelorehanner
It's related to the thin upgrade to 1.4.1 (github.com/macournoyer/thin/issues/115). This is probably why it works for the old Railscast but not now.Selfknowledge
C
14
/home/dimas/RUBY/application/faye-tutorial/faye.ru:3:in `require': cannot load such file -- thin (LoadError)
    from /home/dimas/RUBY/application/faye-tutorial/faye.ru:3:in `block in <main>'

I have the same problem. fix it with:

add this gem to Gemfile

gem 'faye'
gem 'thin'

then bundle install.

Capricorn answered 15/5, 2012 at 4:52 Comment(1)
Many who find this are probably using Rails 4 / Ruby 2, and following Ryan Bate's railscast #260 on faye. $ rackup faye.ru -s thin -E production He doesn't have faye or thin in the gem file. Despite doing a gem install on both faye and thin, @ least for Rails 4, faye & thin need to be in the gem file and a bundle install executed before the server will start.Plante
S
1

If you want to use a gem, it must be in your Gemfile. You can solve your problem as follows:

  • Add the following line to your Gemfile: gem 'thin'
  • Update your current app's environment: bundle install
  • Start the web server: bundle exec thin start
Stargell answered 5/3, 2012 at 20:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.