Sinatra i cant rake -T
I don't know why I cant use rake -T
or bundle exec rake -T
# app.rb
require 'rubygems'
require 'sinatra'
require "sinatra/activerecord"
class App < Sinatra::Base
#configuraciones
set :root, File.dirname(__FILE__)
set :session_secret, 'super secret'
set :public_folder, File.dirname(__FILE__) + '/public'
set :layout, 'views/layouts'
set :database, adapter: "sqlite3", database: "data"
enable :sessions
#before all requests
before do
headers['server'] = 'Ruby, Ubuntu'
end
#registro de helpers de la aplicacion
helpers Sinatra::App::Helpers::Applicaction
helpers Sinatra::App::Helpers::Filters
#registro de helpers de routes
helpers Sinatra::App::Helpers::ErrorHelper
#registro de rutas
register Sinatra::App::Routing::Home
register Sinatra::App::Routing::Departamento
register Sinatra::App::Routing::Provincia
register Sinatra::App::Routing::Error
end
# Rakefile.rb
require 'sinatra'
require "sinatra/activerecord/rake"
require './app'
# config.ru
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
This the error message:
PS C:rubysinatra> bundle exec rake -T
WARNING: If you plan to load any of ActiveSupport's core extensions to Hash, be
sure to do so *before* loading Sinatra::Application or Sinatra::Base. If not,
you may disregard this warning.
rake aborted!
NameError: uninitialized constant Sinatra::App
C:/ruby/sinatra/app.rb:18:in `<class:App>'
C:/ruby/sinatra/app.rb:5:in `<top (required)>'
C:/ruby/sinatra/Rakefile.rb:4:in `<top (required)>'
(See full trace by running task with --trace)
PS C:rubysinatra>
And here is the file structure:
UPDATE
#First Change app.rb
helpers Sinatra::App::Helpers::Application
#This is de helpers.rb
module Sinatra
module App
module Helpers
module Application
def load_css(csss)
rpta = ''
if defined? csss
csss.each do |css|
temp = '<link href="' + CONSTANTS[:static_url] + css + '.css" rel="stylesheet"/>'
rpta = rpta + temp
end
end
rpta
end
def load_js(jss)
rpta = ''
if defined? jss
jss.each do |js|
temp = '<script src="' + CONSTANTS[:static_url] + js + '.js" type="text/javascript"></script>'
rpta = rpta + temp
end
end
rpta
end
end
end
end
end
i have the same error
ruby sqlite sinatra rake
|
show 1 more comment
I don't know why I cant use rake -T
or bundle exec rake -T
# app.rb
require 'rubygems'
require 'sinatra'
require "sinatra/activerecord"
class App < Sinatra::Base
#configuraciones
set :root, File.dirname(__FILE__)
set :session_secret, 'super secret'
set :public_folder, File.dirname(__FILE__) + '/public'
set :layout, 'views/layouts'
set :database, adapter: "sqlite3", database: "data"
enable :sessions
#before all requests
before do
headers['server'] = 'Ruby, Ubuntu'
end
#registro de helpers de la aplicacion
helpers Sinatra::App::Helpers::Applicaction
helpers Sinatra::App::Helpers::Filters
#registro de helpers de routes
helpers Sinatra::App::Helpers::ErrorHelper
#registro de rutas
register Sinatra::App::Routing::Home
register Sinatra::App::Routing::Departamento
register Sinatra::App::Routing::Provincia
register Sinatra::App::Routing::Error
end
# Rakefile.rb
require 'sinatra'
require "sinatra/activerecord/rake"
require './app'
# config.ru
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
This the error message:
PS C:rubysinatra> bundle exec rake -T
WARNING: If you plan to load any of ActiveSupport's core extensions to Hash, be
sure to do so *before* loading Sinatra::Application or Sinatra::Base. If not,
you may disregard this warning.
rake aborted!
NameError: uninitialized constant Sinatra::App
C:/ruby/sinatra/app.rb:18:in `<class:App>'
C:/ruby/sinatra/app.rb:5:in `<top (required)>'
C:/ruby/sinatra/Rakefile.rb:4:in `<top (required)>'
(See full trace by running task with --trace)
PS C:rubysinatra>
And here is the file structure:
UPDATE
#First Change app.rb
helpers Sinatra::App::Helpers::Application
#This is de helpers.rb
module Sinatra
module App
module Helpers
module Application
def load_css(csss)
rpta = ''
if defined? csss
csss.each do |css|
temp = '<link href="' + CONSTANTS[:static_url] + css + '.css" rel="stylesheet"/>'
rpta = rpta + temp
end
end
rpta
end
def load_js(jss)
rpta = ''
if defined? jss
jss.each do |js|
temp = '<script src="' + CONSTANTS[:static_url] + js + '.js" type="text/javascript"></script>'
rpta = rpta + temp
end
end
rpta
end
end
end
end
end
i have the same error
ruby sqlite sinatra rake
4
The error seems to refer to the linehelpers Sinatra::App::Helpers::Applicaction
– where isSinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?
– Stefan
Nov 13 '18 at 8:47
What happens if you putrequire "sinatra/activerecord/rake"
as first line in rakefile ?
– lacostenycoder
Nov 13 '18 at 11:03
IsApplicaction
a typo?
– Mark Thomas
Nov 13 '18 at 11:34
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43
|
show 1 more comment
I don't know why I cant use rake -T
or bundle exec rake -T
# app.rb
require 'rubygems'
require 'sinatra'
require "sinatra/activerecord"
class App < Sinatra::Base
#configuraciones
set :root, File.dirname(__FILE__)
set :session_secret, 'super secret'
set :public_folder, File.dirname(__FILE__) + '/public'
set :layout, 'views/layouts'
set :database, adapter: "sqlite3", database: "data"
enable :sessions
#before all requests
before do
headers['server'] = 'Ruby, Ubuntu'
end
#registro de helpers de la aplicacion
helpers Sinatra::App::Helpers::Applicaction
helpers Sinatra::App::Helpers::Filters
#registro de helpers de routes
helpers Sinatra::App::Helpers::ErrorHelper
#registro de rutas
register Sinatra::App::Routing::Home
register Sinatra::App::Routing::Departamento
register Sinatra::App::Routing::Provincia
register Sinatra::App::Routing::Error
end
# Rakefile.rb
require 'sinatra'
require "sinatra/activerecord/rake"
require './app'
# config.ru
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
This the error message:
PS C:rubysinatra> bundle exec rake -T
WARNING: If you plan to load any of ActiveSupport's core extensions to Hash, be
sure to do so *before* loading Sinatra::Application or Sinatra::Base. If not,
you may disregard this warning.
rake aborted!
NameError: uninitialized constant Sinatra::App
C:/ruby/sinatra/app.rb:18:in `<class:App>'
C:/ruby/sinatra/app.rb:5:in `<top (required)>'
C:/ruby/sinatra/Rakefile.rb:4:in `<top (required)>'
(See full trace by running task with --trace)
PS C:rubysinatra>
And here is the file structure:
UPDATE
#First Change app.rb
helpers Sinatra::App::Helpers::Application
#This is de helpers.rb
module Sinatra
module App
module Helpers
module Application
def load_css(csss)
rpta = ''
if defined? csss
csss.each do |css|
temp = '<link href="' + CONSTANTS[:static_url] + css + '.css" rel="stylesheet"/>'
rpta = rpta + temp
end
end
rpta
end
def load_js(jss)
rpta = ''
if defined? jss
jss.each do |js|
temp = '<script src="' + CONSTANTS[:static_url] + js + '.js" type="text/javascript"></script>'
rpta = rpta + temp
end
end
rpta
end
end
end
end
end
i have the same error
ruby sqlite sinatra rake
I don't know why I cant use rake -T
or bundle exec rake -T
# app.rb
require 'rubygems'
require 'sinatra'
require "sinatra/activerecord"
class App < Sinatra::Base
#configuraciones
set :root, File.dirname(__FILE__)
set :session_secret, 'super secret'
set :public_folder, File.dirname(__FILE__) + '/public'
set :layout, 'views/layouts'
set :database, adapter: "sqlite3", database: "data"
enable :sessions
#before all requests
before do
headers['server'] = 'Ruby, Ubuntu'
end
#registro de helpers de la aplicacion
helpers Sinatra::App::Helpers::Applicaction
helpers Sinatra::App::Helpers::Filters
#registro de helpers de routes
helpers Sinatra::App::Helpers::ErrorHelper
#registro de rutas
register Sinatra::App::Routing::Home
register Sinatra::App::Routing::Departamento
register Sinatra::App::Routing::Provincia
register Sinatra::App::Routing::Error
end
# Rakefile.rb
require 'sinatra'
require "sinatra/activerecord/rake"
require './app'
# config.ru
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
This the error message:
PS C:rubysinatra> bundle exec rake -T
WARNING: If you plan to load any of ActiveSupport's core extensions to Hash, be
sure to do so *before* loading Sinatra::Application or Sinatra::Base. If not,
you may disregard this warning.
rake aborted!
NameError: uninitialized constant Sinatra::App
C:/ruby/sinatra/app.rb:18:in `<class:App>'
C:/ruby/sinatra/app.rb:5:in `<top (required)>'
C:/ruby/sinatra/Rakefile.rb:4:in `<top (required)>'
(See full trace by running task with --trace)
PS C:rubysinatra>
And here is the file structure:
UPDATE
#First Change app.rb
helpers Sinatra::App::Helpers::Application
#This is de helpers.rb
module Sinatra
module App
module Helpers
module Application
def load_css(csss)
rpta = ''
if defined? csss
csss.each do |css|
temp = '<link href="' + CONSTANTS[:static_url] + css + '.css" rel="stylesheet"/>'
rpta = rpta + temp
end
end
rpta
end
def load_js(jss)
rpta = ''
if defined? jss
jss.each do |js|
temp = '<script src="' + CONSTANTS[:static_url] + js + '.js" type="text/javascript"></script>'
rpta = rpta + temp
end
end
rpta
end
end
end
end
end
i have the same error
ruby sqlite sinatra rake
ruby sqlite sinatra rake
edited Nov 14 '18 at 0:01
Frank Macavilca
asked Nov 13 '18 at 7:52
Frank MacavilcaFrank Macavilca
11
11
4
The error seems to refer to the linehelpers Sinatra::App::Helpers::Applicaction
– where isSinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?
– Stefan
Nov 13 '18 at 8:47
What happens if you putrequire "sinatra/activerecord/rake"
as first line in rakefile ?
– lacostenycoder
Nov 13 '18 at 11:03
IsApplicaction
a typo?
– Mark Thomas
Nov 13 '18 at 11:34
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43
|
show 1 more comment
4
The error seems to refer to the linehelpers Sinatra::App::Helpers::Applicaction
– where isSinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?
– Stefan
Nov 13 '18 at 8:47
What happens if you putrequire "sinatra/activerecord/rake"
as first line in rakefile ?
– lacostenycoder
Nov 13 '18 at 11:03
IsApplicaction
a typo?
– Mark Thomas
Nov 13 '18 at 11:34
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43
4
4
The error seems to refer to the line
helpers Sinatra::App::Helpers::Applicaction
– where is Sinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?– Stefan
Nov 13 '18 at 8:47
The error seems to refer to the line
helpers Sinatra::App::Helpers::Applicaction
– where is Sinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?– Stefan
Nov 13 '18 at 8:47
What happens if you put
require "sinatra/activerecord/rake"
as first line in rakefile ?– lacostenycoder
Nov 13 '18 at 11:03
What happens if you put
require "sinatra/activerecord/rake"
as first line in rakefile ?– lacostenycoder
Nov 13 '18 at 11:03
Is
Applicaction
a typo?– Mark Thomas
Nov 13 '18 at 11:34
Is
Applicaction
a typo?– Mark Thomas
Nov 13 '18 at 11:34
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43
|
show 1 more comment
1 Answer
1
active
oldest
votes
I SOLVE THAT I HAD TO ADD IN app.rb
require File.dirname(__FILE__) + '/config/initializers/helpers.rb'
require File.dirname(__FILE__) + '/config/initializers/filters.rb'
require File.dirname(__FILE__) + '/helpers/error_helper.rb'
require File.dirname(__FILE__) + '/routes/error.rb'
require File.dirname(__FILE__) + '/routes/home.rb'
but i dont know why my boot.rb doesnt work
config.ru
#!/usr/bin/env rackup
# encoding: utf-8
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
boot.rb
#registro de rutas
Dir["./routes/*.rb"].each
#registro de initializers
Dir["./config/initializers/*.rb"].each
#registro de modelos
Dir["./models/*_model.rb"].each
#helpers
Dir["./helpers/*_helper.rb"].each
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276228%2fsinatra-i-cant-rake-t%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I SOLVE THAT I HAD TO ADD IN app.rb
require File.dirname(__FILE__) + '/config/initializers/helpers.rb'
require File.dirname(__FILE__) + '/config/initializers/filters.rb'
require File.dirname(__FILE__) + '/helpers/error_helper.rb'
require File.dirname(__FILE__) + '/routes/error.rb'
require File.dirname(__FILE__) + '/routes/home.rb'
but i dont know why my boot.rb doesnt work
config.ru
#!/usr/bin/env rackup
# encoding: utf-8
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
boot.rb
#registro de rutas
Dir["./routes/*.rb"].each
#registro de initializers
Dir["./config/initializers/*.rb"].each
#registro de modelos
Dir["./models/*_model.rb"].each
#helpers
Dir["./helpers/*_helper.rb"].each
add a comment |
I SOLVE THAT I HAD TO ADD IN app.rb
require File.dirname(__FILE__) + '/config/initializers/helpers.rb'
require File.dirname(__FILE__) + '/config/initializers/filters.rb'
require File.dirname(__FILE__) + '/helpers/error_helper.rb'
require File.dirname(__FILE__) + '/routes/error.rb'
require File.dirname(__FILE__) + '/routes/home.rb'
but i dont know why my boot.rb doesnt work
config.ru
#!/usr/bin/env rackup
# encoding: utf-8
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
boot.rb
#registro de rutas
Dir["./routes/*.rb"].each
#registro de initializers
Dir["./config/initializers/*.rb"].each
#registro de modelos
Dir["./models/*_model.rb"].each
#helpers
Dir["./helpers/*_helper.rb"].each
add a comment |
I SOLVE THAT I HAD TO ADD IN app.rb
require File.dirname(__FILE__) + '/config/initializers/helpers.rb'
require File.dirname(__FILE__) + '/config/initializers/filters.rb'
require File.dirname(__FILE__) + '/helpers/error_helper.rb'
require File.dirname(__FILE__) + '/routes/error.rb'
require File.dirname(__FILE__) + '/routes/home.rb'
but i dont know why my boot.rb doesnt work
config.ru
#!/usr/bin/env rackup
# encoding: utf-8
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
boot.rb
#registro de rutas
Dir["./routes/*.rb"].each
#registro de initializers
Dir["./config/initializers/*.rb"].each
#registro de modelos
Dir["./models/*_model.rb"].each
#helpers
Dir["./helpers/*_helper.rb"].each
I SOLVE THAT I HAD TO ADD IN app.rb
require File.dirname(__FILE__) + '/config/initializers/helpers.rb'
require File.dirname(__FILE__) + '/config/initializers/filters.rb'
require File.dirname(__FILE__) + '/helpers/error_helper.rb'
require File.dirname(__FILE__) + '/routes/error.rb'
require File.dirname(__FILE__) + '/routes/home.rb'
but i dont know why my boot.rb doesnt work
config.ru
#!/usr/bin/env rackup
# encoding: utf-8
require_relative 'config/boot'
require File.dirname(__FILE__) + '/app'
run App
boot.rb
#registro de rutas
Dir["./routes/*.rb"].each
#registro de initializers
Dir["./config/initializers/*.rb"].each
#registro de modelos
Dir["./models/*_model.rb"].each
#helpers
Dir["./helpers/*_helper.rb"].each
answered Nov 14 '18 at 0:41
Frank MacavilcaFrank Macavilca
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276228%2fsinatra-i-cant-rake-t%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
The error seems to refer to the line
helpers Sinatra::App::Helpers::Applicaction
– where isSinatra::App::Helpers::Applicaction
defined? Is that the correct namespace? Could you show its source?– Stefan
Nov 13 '18 at 8:47
What happens if you put
require "sinatra/activerecord/rake"
as first line in rakefile ?– lacostenycoder
Nov 13 '18 at 11:03
Is
Applicaction
a typo?– Mark Thomas
Nov 13 '18 at 11:34
@Stefan i'll show you just i forgot my code at home
– Frank Macavilca
Nov 13 '18 at 14:39
@lacostenycoder i think i did that but i will try again
– Frank Macavilca
Nov 13 '18 at 14:43