Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can't run the example! #2

Open
robsalasco opened this issue Feb 10, 2014 · 2 comments
Open

Can't run the example! #2

robsalasco opened this issue Feb 10, 2014 · 2 comments

Comments

@robsalasco
Copy link

Hi! I'm having this problem

/Users/rob/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sinatra-formkeeper-0.0.7/lib/sinatra/formkeeper.rb:127:in `<module:Sinatra>': undefined method `register' for Sinatra:Module (NoMethodError)
    from /Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sinatra-formkeeper-0.0.7/lib/sinatra/formkeeper.rb:26:in `<top (required)>'
    from /Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
    from form.rb:1:in `<main>'

Can you help me please? Thank you.

@lyokato
Copy link
Owner

lyokato commented Feb 10, 2014

Hi,

Thank you for your report.
But it's not enough to dig into the problem.

Did you make sure to write

require 'sinatra'
or
require 'sinatra/base'

before
require 'sinatra/formkeeper'

On Mon, Feb 10, 2014 at 1:50 PM, robsalasco [email protected]:

Hi! I'm having this problem

'''
/Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sinatra-formkeeper-0.0.7/lib/sinatra/formkeeper.rb:127:in
module:Sinatra': undefined methodregister' for Sinatra:Module
(NoMethodError)
from
/Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sinatra-formkeeper-0.0.7/lib/sinatra/formkeeper.rb:26:in
<top (required)>'
from
/Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in
require'
from
/Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in
rescue in require'
from
/Users/x0r/.rbenv/versions/1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in
require'
from form.rb:1:in `'
'''

Can you help me please? Thank you.

Reply to this email directly or view it on GitHubhttps://github.com//issues/2
.


Lyo Kato [email protected]

@gma
Copy link

gma commented May 27, 2014

I've just seen some similar behaviour, but in this case the problem was simply that adding sinatra-formkeeper to the project's Gemfile was enough to load the extension before sinatra/base was required.

Changing the Gemfile to this (and then requiring sinatra/formkeeper manually in the code) sorted it:

gem "sinatra-formkeeper", require: nil

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

No branches or pull requests

3 participants