I have a Rails application with GraphQL API which works fine when running in development. After I deployed the app to Heroku, visiting the GraphiQL interface at /graphiql I get this error below:
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
at n.default (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:597)
at u (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at o (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at M (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at R (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at new P (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at P (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807)
at Object.129.../jsutils/isInvalid (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:815)
at i (application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12)
at application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
n.default # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:597
u # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
o # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
M # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
R # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
P # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
P # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:807
129.../jsutils/isInvalid # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:815
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
132.../error/GraphQLError # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:831
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
96../execution/execute # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:588
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
97../error # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:588
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:84
12.../utility/CodeMirrorSizer # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:84
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
22../components/GraphiQL # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:139
i # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
t # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
(anonymous) # application-d621ca4100ba6f2e72e972ecd2a7ddcd5d2ec26b6f1fcf2932d68e2e12c78794.js:12
Meanwhile, here's my routes file:
Rails.application.routes.draw do
mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql'
get 'home/index'
post '/graphql', to: 'graphql#execute'
root 'home#index'
end
And I am using these versions of graphql and graphiql-rails respectively:
graphql (1.10.8)
graphiql-rails (1.7.0)
I am using "Turbolinks 5.1.0".
file: Gemfile
gem 'turbolinks', '~> 5.1'
file: application layout header
<%= javascript_include_tag "application", nonce: true %>
file: config/initializers/content_security_policy.rb
Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
Google chrome console error
VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
[Report Only] Refused to execute inline script because it violates the
following Content Security Policy directive: "script-src 'self' https:
'unsafe-inline' 'nonce-UiVx2CiP0HHN9jOOSEG43g=='". Note that
'unsafe-inline' is ignored if either a hash or nonce value is present
in the source list.
n.assignNewBody # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
n.replaceBody # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
(anonymous) # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
t.renderView # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
n.render # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
t.render # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
e.renderSnapshot # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
e.render # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
t.render # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
(anonymous) # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
(anonymous) # VM32 application-ae291f799496478302742f713e72f20a7958b7077387b87e18ab98c51ec979c4.js:243
To solve this problem, seems I have two solutions as listed below
1) Use the data-turbolinks-track: reload
<%= javascript_include_tag "application", 'data-turbolinks-track': :reload, nonce: true %>
OR
2) Reuse the same nonce using session-store for turbolink requests, is this correct way of solving this problem?
Rails.application.config.content_security_policy_nonce_generator = -> request do
# use the same csp nonce for turbolinks requests
if request.env["HTTP_TURBOLINKS_REFERRER"].present? && request.session["mykey"].present?
request.session["mykey"]
else
request.session["mykey"] = SecureRandom.base64(16)
end
end
Please suggest the correct solution here!
I receive a stack overflow error without any repeating pattern when calling a wrapper for a native method
here's my adapter
import 'dart:js';
import 'package:share_place/users/user.dart';
import 'package:logging/logging.dart';
class MixPanel {
Logger log = new Logger("MixPanel");
JsObject mixpanel;
init(User user) {
mixpanel = context["mixpanel"];
if( user != null ) {
mixpanel.callMethod("identify", [user.id]);
mixpanel['people'].callMethod("set", [new JsObject.jsify({
"\$email": user.mainMail,
"\$first_name": user.displayName,
"name": user.displayName,
"skype": user.skype,
"photoId": "/auth/gridfs/file/${user.photoIdM}/picture.x"
})]);
}
}
void track(String action, {Map data:null}) {
log.fine("calling mixpanel with action '$action', $mixpanel");
assert(mixpanel != null, "mixpanel must be initialized before calling this method");
mixpanel.callMethod("track", [action, data != null ? new JsObject.jsify(data) : ""]);
}
}
here's the stack of my call, notice there's no repeating pattern, is it possible that we really reached to max allowed sequential calls?:
html_dart2js.dart:3558 SEVERE - Environment : mix panel call failed Stack Overflow
dart.alh.$1 # html_dart2js.dart:3558
dart.Fj.func # zone.dart:1132
o3 # zone.dart:1309
aN # stream_impl.dart:330
dart.eu.cS # stream_impl.dart:257
aN # broadcast_stream_controller.dart:379
zU # broadcast_stream_controller.dart:254
R3 # logging.dart:195
lC # main.dart.js:33122
FM # logging.dart:226
fk # main.dart.js:33135
dL # environment.dart:344
J.cE # main.dart.js:54489
(anonymous) # info_popup.dart:57
(anonymous) # async_patch.dart:213
dart.acx.$2 # async_patch.dart:237
dart.aby.$1 # async_patch.dart:187
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
du # future_impl.dart:468
(anonymous) # future_impl.dart:51
J.Nd # main.dart.js:54209
K # async_patch.dart:164
(anonymous) # place_service.dart:602
(anonymous) # async_patch.dart:213
dart.acx.$2 # async_patch.dart:237
dart.aby.$1 # async_patch.dart:187
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
du # future_impl.dart:468
(anonymous) # future_impl.dart:51
J.Nd # main.dart.js:54209
K # async_patch.dart:164
(anonymous) # place_service.dart:108
(anonymous) # async_patch.dart:213
dart.acx.$2 # async_patch.dart:237
dart.aby.$1 # async_patch.dart:187
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
tc # future_impl.dart:478
dart.a7C.$0 # future_impl.dart:510
dart.Wc.$0 # ng_zone.dart:161
dart.Fh.func # zone.dart:1120
E8 # zone.dart:675
dart.cJ.Wi # ng_zone.dart:175
(anonymous) # VM5234:2
cz # zone.dart:1001
hU # zone.dart:901
dart.a7e.$0 # zone.dart:926
acj # schedule_microtask.dart:41
dart.auX # schedule_microtask.dart:50
dart.a6A.$1 # async_patch.dart:51
$0 # js_helper.dart:2456
nl # isolate_helper.dart:474
lK # isolate_helper.dart:59
dart.al3 # js_helper.dart:2456
(anonymous) # js_helper.dart:2476
childList (async)
$1 # async_patch.dart:67
Fm # async_patch.dart:28
dart.u8 # zone.dart:1176
wW # zone.dart:743
dart.cJ.VY # ng_zone.dart:169
(anonymous) # VM5240:2
hY # zone.dart:1076
b3 # future_impl.dart:509
(anonymous) # future_impl.dart:40
dart.Q2.$1 # browser_client.dart:62
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
du # future_impl.dart:468
k0 # stream_pipe.dart:63
dart.a_s.$1 # stream.dart:997
dart.a7v.$1 # html_dart2js.dart:42920
dart.Fj.func # zone.dart:1132
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
o3 # zone.dart:909
dart.a7g.$1 # zone.dart:936
$0 # js_helper.dart:2456
nl # isolate_helper.dart:474
lK # isolate_helper.dart:59
dart.al3 # js_helper.dart:2456
(anonymous) # js_helper.dart:2476
FileReader (async)
dart.Q4.$1 # browser_client.dart:77
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
du # future_impl.dart:468
k0 # stream_pipe.dart:63
dart.a_s.$1 # stream.dart:997
dart.a7v.$1 # html_dart2js.dart:42920
dart.Fj.func # zone.dart:1132
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
o3 # zone.dart:909
dart.a7g.$1 # zone.dart:936
$0 # js_helper.dart:2456
nl # isolate_helper.dart:474
lK # isolate_helper.dart:59
dart.al3 # js_helper.dart:2456
(anonymous) # js_helper.dart:2476
XMLHttpRequest.send (async)
(anonymous) # html_dart2js.dart:20547
J.ha # main.dart.js:54426
(anonymous) # browser_client.dart:88
(anonymous) # async_patch.dart:213
dart.acx.$2 # async_patch.dart:237
dart.aby.$1 # async_patch.dart:187
dart.Fj.func # zone.dart:1128
Ed # zone.dart:685
dart.cJ.Wm # ng_zone.dart:184
(anonymous) # VM5236:2
jp # zone.dart:1012
PX # future_impl.dart:129
$0 # future_impl.dart:636
iN # future_impl.dart:665
tc # future_impl.dart:478
dart.a7C.$0 # future_impl.dart:510
dart.Wc.$0 # ng_zone.dart:161
dart.Fh.func # zone.dart:1120
E8 # zone.dart:675
dart.cJ.Wi # ng_zone.dart:175
(anonymous) # VM5234:2
cz # zone.dart:1001
hU # zone.dart:901
dart.a7e.$0 # zone.dart:926
acj # schedule_microtask.dart:41
dart.auX # schedule_microtask.dart:50
dart.a6A.$1 # async_patch.dart:51
$0 # js_helper.dart:2456
nl # isolate_helper.dart:474
lK # isolate_helper.dart:59
dart.al3 # js_helper.dart:2456
(anonymous) # js_helper.dart:2476
childList (async)
$1 # async_patch.dart:67
Fm # async_patch.dart:28
dart.u8 # zone.dart:1176
wW # zone.dart:743
dart.cJ.VY # ng_zone.dart:169
(anonymous) # VM5240:2
hY # zone.dart:1076
kH # future_impl.dart:342
um # future_impl.dart:251
tQ # async_patch.dart:206
L # async_patch.dart:142
U # info_popup.dart:59
n # files_comp.template.dart:1397
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:1222
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:677
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:532
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:488
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:337
w # app_view.dart:341
I # view_container.dart:57
n # files_comp.template.dart:173
w # app_view.dart:341
n # app_component.template.dart:761
w # app_view.dart:341
n # app_component.template.dart:1980
w # app_view.dart:341
MO # view_ref.dart:104
wu # application_ref.dart:422
dart.Pl.$0 # application_ref.dart:278
dart.Fh.func # zone.dart:1120
E8 # zone.dart:675
dart.cJ.Wi # ng_zone.dart:175
(anonymous) # VM5234:2
cz # zone.dart:1001
hU # zone.dart:901
hU # ng_zone.dart:310
dart.Ps.$1 # application_ref.dart:277
o3 # zone.dart:1307
aN # stream_impl.dart:330
dart.eu.cS # stream_impl.dart:257
$1 # broadcast_stream_controller.dart:387
tq # broadcast_stream_controller.dart:328
aN # broadcast_stream_controller.dart:386
mv # broadcast_stream_controller.dart:254
dart.cJ.Wi # ng_zone.dart:213
(anonymous) # VM5234:2
cz # zone.dart:1001
hU # zone.dart:901
hU # ng_zone.dart:310
dart.Ph.$1 # app_view.dart:566
$0 # js_helper.dart:2456
nl # isolate_helper.dart:474
lK # isolate_helper.dart:59
dart.al3 # js_helper.dart:2456
(anonymous) # js_helper.dart:2476
js_primitives.dart:30 popup init
I cannot find where to start to solve this issue.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
Just for SF I must add this text so there's not too much code for too few text.
The error was due to an argument I was passing to the method that was badly serialized.
Sorry I can't give any more details, removing an argument from the call made it ok (I took out the data I wanted from the argument to pass as independent parameters)
I have this leak in Indy 10.5.7 (under Delphi 7).
5 - 12 bytes: TIdThreadSafeInteger x 1
21 - 36 bytes: TIdCriticalSection x 2
I use Indy like this:
function getWeb(a,b:Integer):Integer;
var url: string;
H: TIdHttp;
SS: TStringStream;
begin
url := 'http://blabla';
H := TIdHttp.Create(nil);
try
SS := TStringStream.Create('');
try
H.Get(url, SS);
Result := StrToInt(SS.DataString);
FINALLY
SS.Free;
END;
finally H.Free;
end;
The leak itself doesn't bother me since is on app shutdown. That makes my melon explode is the error message I see every time I shut down the app.
Why this leak appear?
I have checked the Indy web site but it barely makes sense. Anyway, it looks this bug cannot be fixed: the latest version of Indy cannot be compiled with Delphi 7. The only solution might be Indy 9.
Update: it looks like what on the web site calls v10.203 is is actually v10.2.3.
This is a problem that occurs with FastMM memory manager and has been around for a while and there is a lot of information available on fixes. The solution I use in Delphi 2010 is:
Make the changes below to the file IdGlobal.pas
Add the path "C:\Program Files\Embarcadero\RAD Studio\7.0\source\Indy\Indy10\System" (without quotes) to the library.
Changes:
{$IFNDEF DOTNET}
{$IFDEF REGISTER_EXPECTED_MEMORY_LEAK}
function IndyRegisterExpectedMemoryLeak(AAddress: Pointer): Boolean;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
// ===== My modification begins =====================
Result := FastMM4.RegisterExpectedMemoryLeak(AAddress);
Exit;
// ===== My modification ends =====================
Hope this helps.
There is a IdStack validation file which does not pass through the cleaning function.
Open the file IdStack.pas
At the end of the file, look for this:
{$ IFNDEF DOTNET}
{$ IFDEF} REGISTER_EXPECTED_MEMORY_LEAK
IndyRegisterExpectedMemoryLeak (GStackCriticalSection);
{$ ENDIF}
{$ ENDIF}
finalization
// Dont Free. If shutdown is from another Init section, it can cause GPF When stack
// Tries to access it. App will kill it off anyways, so just let it leak
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
// THIS LINE AND INCLUDE A COMMENT LINE DOWN
if GStackCriticalSection <> nil then FreeAndNil (GStackCriticalSection);
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
{$ IFDEF} FREE_ON_FINAL
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
// FreeAndNil (GStackCriticalSection); // DISABLE THIS LINE
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
{$ ENDIF}
end.
I'm using version 10.515 from Indy, you can find this version for download at http://indy.fulgan.com/ZIP/
to remove other message includes this command in the main DPR
Application.terminate;
if GThreadCount <> Nil then GThreadCount.Free;
Add IdThread uses.
Even more!
Using RVM. Updated from ruby 1.9.2-p290 to 1.9.3-p194.
bundle install works fine.
When I try to run any rails task I am getting an error:
Tylers-MacBook-Pro:csbb Tyler$ rails c --sandox
/Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:77:in `rescue in rescue in block in require': undefined method `gsub' for nil:NilClass (NoMethodError)
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:72:in `rescue in block in require'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:62:in `block in require'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /Users/Tyler/Development/Rails/csbb/config/application.rb:13:in `<top (required)>'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands.rb:39:in `require'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.2.1'
gem 'devise'
gem 'heroku'
gem 'typhoeus'
gem 'capistrano'
gem 'rvm-capistrano'
gem 'capistrano-ext'
gem 'launchy'
gem 'mysql2'
gem 'cancan'
gem 'database_cleaner'
gem 'stripe'
gem 'will_paginate', '~> 3.0'
gem 'turkee', :git => "https://github.com/workmaster2n/turkee.git", ref: '04da1de00ac02cff33341fa677ab2dd9212d4086'
gem 'yettings'
gem 'nokogiri'
gem 'htmlentities'
gem 'rest-client'
gem 'ruby-debug-base19x', '0.11.30.pre10'
gem 'ruby-debug-ide', '0.4.17.beta14'
group :development do
gem 'rspec-rails'
gem 'guard-rspec'
gem 'annotate'
gem 'thin'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'twitter-bootstrap-rails'
end
gem 'jquery-rails'
group :test do
gem 'rspec-rails'
gem 'capybara'
gem 'capybara-webkit'
gem 'rb-fsevent', :require => false
gem 'growl'
gem 'guard-spork'
gem 'spork', '~> 0.9.0.rc'
gem 'factory_girl_rails'
gem 'vcr'
gem 'fakeweb'
end
group :production do
end
application.rb (line 13 is: Bundler.require(*Rails.groups(:assets => %w(development test))):
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module WeaponXO
class Application < Rails::Application
config.csbb = ActiveSupport::OrderedOptions.new
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password, :password_confirmation]
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
# config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
EDIT
If I comment out line 13 of application.rb, I get this error (expected):
/Users/Tyler/Development/Rails/csbb/config/initializers/devise.rb:3:in `<top (required)>': uninitialized constant Devise (NameError)
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/engine.rb:587:in `each'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/engine.rb:587:in `block in <class:Engine>'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/Tyler/Development/Rails/csbb/config/environment.rb:5:in `<top (required)>'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/application.rb:103:in `require'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/application.rb:103:in `require_environment!'
from /Users/Tyler/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.1/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
devise.rb
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "support#weaponxo.com"
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
# Automatically apply schema changes in tableless databases
config.apply_schema = false
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require 'devise/orm/active_record'
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
# config.authentication_keys = [ :email ]
# Configure parameters from the request object used for authentication. Each entry
# given should be a request method and it will automatically be passed to the
# find_for_authentication method and considered in your model lookup. For instance,
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
# The same considerations mentioned for authentication_keys also apply to request_keys.
# config.request_keys = []
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [ :email ]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
# given strategies, for example, `config.params_authenticatable = [:database]` will
# enable it only for database (email + password) authentication.
# config.params_authenticatable = true
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
# It can be set to an array that will enable http authentication only for the
# given strategies, for example, `config.http_authenticatable = [:token]` will
# enable it only for token authentication.
# config.http_authenticatable = false
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
# The realm used in Http Basic Authentication. "Application" by default.
# config.http_authentication_realm = "Application"
# It will change confirmation, password recovery and other workflows
# to behave the same regardless if the e-mail provided was right or wrong.
# Does not affect registerable.
# config.paranoid = true
# By default Devise will store the user in session. You can skip storage for
# :http_auth and :token_auth by adding those symbols to the array below.
# Notice that if you are skipping storage for all authentication paths, you
# may want to disable generating routes to Devise's sessions controller by
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
#
# Limiting the stretches to just one in testing will increase the performance of
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
# a value less than 10 in other environments.
config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
# config.pepper = "414a4a386818bbd8897a8a083af56bd752a4e17d7daf490c598fae61d210ca5695d871fbbed21e9070b99804c7a52ff7c0227793cf925678ccf71d3112fd09d8"
# ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without
# confirming his account. For instance, if set to 2.days, the user will be
# able to access the website for two days without confirming his account,
# access will be blocked just in the third day. Default is 0.days, meaning
# the user cannot access the website without confirming his account.
# config.allow_unconfirmed_access_for = 2.days
# If true, requires any email changes to be confirmed (exctly the same way as
# initial account confirmation) to be applied. Requires additional unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful confirmation.
config.reconfirmable = true
# Defines which key will be used when confirming an account
# config.confirmation_keys = [ :email ]
# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks
# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false
# If true, uses the password salt as remember token. This should be turned
# to false if you are not using database authenticatable.
config.use_salt_as_remember_token = true
# Options to be passed to the created cookie. For instance, you can set
# :secure => true in order to force SSL only cookies.
# config.cookie_options = {}
# ==> Configuration for :validatable
# Range for password length. Default is 6..128.
# config.password_length = 6..128
# Email regex used to validate email formats. It simply asserts that
# an one (and only one) # exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
# config.email_regexp = /\A[^#]+#[^#]+\z/
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
# :none = No lock strategy. You should handle locking by yourself.
# config.lock_strategy = :failed_attempts
# Defines which key will be used when locking and unlocking an account
# config.unlock_keys = [ :email ]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
# :both = Enables both strategies
# :none = No unlock strategy. You should handle unlocking by yourself.
# config.unlock_strategy = :both
# Number of authentication tries before locking an account if lock_strategy
# is failed attempts.
# config.maximum_attempts = 20
# Time interval to unlock the account if :time is enabled as unlock_strategy.
# config.unlock_in = 1.hour
# ==> Configuration for :recoverable
#
# Defines which key will be used when recovering the password for an account
# config.reset_password_keys = [ :email ]
# Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to
# change their passwords.
config.reset_password_within = 6.hours
# ==> Configuration for :encryptable
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
# REST_AUTH_SITE_KEY to pepper)
# config.encryptor = :sha512
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
# config.token_authentication_key = :auth_token
# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
# are using only default views.
# config.scoped_views = false
# Configure the default scope given to Warden. By default it's the first
# devise role declared in your routes (usually :user).
# config.default_scope = :user
# Configure sign_out behavior.
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
# The default is true, which means any logout action will sign out all active scopes.
# config.sign_out_all_scopes = true
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
# :html, should redirect to the sign in page when the user does not have
# access, but formats like :xml or :json, should return 401.
#
# If you have any extra navigational formats, like :iphone or :mobile, you
# should add them to the navigational formats lists.
#
# The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ["*/*", :html]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete
# ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks.
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
#
# config.warden do |manager|
# manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
# end
end
FIXED
Something happened with my install of ruby 1.9.3. Read to update RVM before installing new versions of ruby (http://www.fakingfantastic.com/2010/11/26/fixing-the-you-have-to-install-development-tools-first-error-with-nokogiri/). From that page:
rvm update head #I did rvm get stable
rvm --force install 1.9.3
gem install bundle
Did I forget to update something along the way?
Something happened with my install of ruby 1.9.3. Read to update RVM before installing new versions of ruby (http://www.fakingfantastic.com/2010/11/26/fixing-the-you-have-to-install-development-tools-first-error-with-nokogiri/). From that page:
rvm update head #I did rvm get stable
rvm --force install 1.9.3
gem install bundle
Bundle.require makes sure all gems installed are imported when your app runs. If you comment it out, add require "devise"
run
gem update
comment the below line from config/development.rb
config.action_view.debug_rjs = true
and add
config.assets.compress = false
config.assets.debug = true
have a look into asset pipeline, if you do want to take an advantage though it's optional. As i see asset related gems present in your gem file so suggested some changes to me made. Create app/assets and directory and move the javascripts,stylesheets,images from public folder.