-2

I am following the "Getting Started on Heroku with Ruby (Microsoft Windows)" tutorial.

I have followed the steps carefully. However, when I entered this command...

jruby -S bin\rake db:create db:migrate --trace

(which can be found in this page; look for the line "Now you can create the appropriate database and tables for the app using this rake task:".)

...I got this error:

rake aborted!
LoadError: load error:
C:/Users/username/Desktop/jruby-getting-started/config/boot -- java.lang.IllegalAccessException: Can not set static final boolean field javax.crypto.JceSecurity.isRestricted to java.lang.Boolean
org/jruby/RubyKernel.java:940:in require'
C:/Users/username/Desktop/jruby-getting-started/config/application.rb:1:in
'
org/jruby/RubyKernel.java:940:in require'
C:/Users/username/Desktop/jruby-getting-started/rakefile:1:in
'
org/jruby/RubyKernel.java:958:in load'
C:/Users/username/Desktop/jruby-getting-started/rakefile:4:in
(root)'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:1:in (root)'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:28:in
block in load_rakefile'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:694:in raw_load_rakefile'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:100:in
load_rakefile'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:182:in block in standard_exception_handling'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:99:in
load_rakefile'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:83:in run'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:182:in
'
org/jruby/RubyKernel.java:958:in load' bin\rake:17:in'

I have followed this tutorial, too, and I got a "rake aborted!" related error, too. This one:

rake aborted!
LoadError: cannot load such file -- 2.2/pg_ext
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:in
rescue in '
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:3:in <top (required)>'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in block (2 levels) in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in
each'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in block in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
each'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
require'
C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:in <top (required)>'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
require'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in <top (required)>'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
load'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
raw_load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:94:in block in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in
standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
block in run'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
run'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in <top (required)>'
C:/tools/ruby22/bin/rake:23:in
load'
C:/tools/ruby22/bin/rake:23:in <main>'
LoadError: cannot load such file -- pg_ext
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:4:in
require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:4:in <top (required)>'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in block (2 levels) in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in
each'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in block in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
each'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
require'
C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:in <top (required)>'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
require'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in <top (required)>'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
load'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
raw_load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:94:in block in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in
standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:in load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
block in run'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
run'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in <top (required)>'
C:/tools/ruby22/bin/rake:23:in
load'
C:/tools/ruby22/bin/rake:23:in `'

Thank you in advance for your answers/solutions.

EDIT:
I am on Windows 10. This problem, was solved reading the answer found here: I get a pg error when trying to destroy a controller.

Then, another problem came up, which was solved reading the answer found here:
PG::ConnectionBad FATAL: role “Myname” does not exist.

Then, another problem came up, which was solved reading the answer found here:
Resolving TZInfo::DataSourceNotFound Errors.

Then, another problem came up, when trying to run an app locally, via this command:
heroku local

[OKAY] Loaded ENV .env File as KEY=VALUE Format
3:44:09 PM web.1 | ERROR: worker mode not supported on JRuby or Windows
[DONE] Killing all processes with signal null 3:44:09 PM web.1 Exited with exit code 1

I read the advice on the second aforementioned tutorial, by adding a Procfile.windows file (modified as: web: ruby -S puma -t 5:5 -p %PORT% -e development) in the root directory.

Then, another problem came up, when trying to run an app locally, via this command:
heroku local web -f Procfile.windows

[OKAY] Loaded ENV .env File as KEY=VALUE Format 3:55:01 PM web.1 | C:/Program Files/Heroku/ruby-2.1.7/lib/ruby/2.1.0/rubygems/dependency.rb:298:in to_specs' [DONE] Killing all processes with signal null 3:55:01 PM web.1 | : Could not find 'puma' (>= 0) among 8 total gem(s) (Gem::LoadError) 3:55:01 PM web.1 | from C:/Program Files/Heroku/ruby-2.1.7/lib/ruby/2.1.0/rubygems/dependency.rb:309:in to_spec' 3:55:01 PM web.1 | from C:/Program Files/Heroku/ruby-2.1.7/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in gem' 3:55:01 PM web.1 | from C:/tools/ruby22/bin/puma:22:in ' 3:55:01 PM web.1 Exited with exit code 1

As of yet, I cannot find a solution for this one. It seems that the problem is that Heroku uses internally another version of Ruby (that's the v2.1.7 one as shown above, instead of the v2.2.4 installed elsewhere), which does not contain the gem named "puma".

cogitator
  • 7
  • 1
  • @JonnyHenly Thanks. It's in [this page](https://devcenter.heroku.com/articles/getting-started-with-jruby#run-the-app-locally). Look for the line "*Now you can create the appropriate database and tables for the app using this rake task:*". – cogitator Aug 02 '16 at 22:19

1 Answers1

0

Regarding your original problem, you probably need to install the Unlimited JCE into your local JDK. You can download them here: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

codefinger
  • 10,088
  • 7
  • 39
  • 51