Notmethod error when starting padrino

unfortunately lost in the beginning. Created the first test_app using the official guide http://www.padrinorb.com/

When I try to start the padrino start application, the server works well on the console, but as soon as I try to see it in borwser, this error message appears:

NoMethodError at / admin / undefined method `match? 'for nil: NilClass file: routing.rb location: route: 66

Also, I do not see the icons, and the console says that it can not find this.

(Tried with Thin as well as Webrick. I use Ubuntu with RVM Ruby1.9 Gem 1.3.7 Rails3. Updated Sinatra and Padrino jewels made by cleaning.)

Thanks a lot, gezope

+3
source share
2 answers

The best solution is probably to bind the version of sinatra you are using to a version compatible with sinatra 0.9.19. Sinatra 1.1.0 works great for me. To do this, add this line to your Gemfile:

gem 'sinatra', '1.1.0'

and call

bundle update

You will use bundle exec padrinofrom there.

+6
source

This is a quick hack that can solve it. This should probably be resolved within the framework, but at least you can solve it right now so that you can continue to work:

(, bundler) ( : , "" , Padrino): :.bundle/ruby ​​/1.8/gems/padrino-core-0.9.19/lib/padrino-core/application/routing.rb

( ):

   def route
      match.matched? ? match.path.route : nil  # NOTE: this is line 66 in routing.rb
    end

(, )

   def route
      (!match.nil? && match.matched?) ? match.path.route : nil
    end

!

+1

Source: https://habr.com/ru/post/1782211/


All Articles