Heroku - JRuby - 耙子流产了! - java.lang.IllegalAccessException

时间:2016-08-02 22:07:43

标签: java ruby heroku rake jruby

我正在关注"使用Ruby(Microsoft Windows)"教程。

我已仔细按照步骤操作。但是,当我输入此命令时......

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

(可在this page中找到;查找行&#34;现在,您可以使用此rake任务为应用创建适当的数据库和表:&#34;。)< / em>的

......我收到了这个错误:

  耙子中止了!
  LoadError:加载错误:
  C:/ Users / username / Desktop / jruby-getting-started / config / boot -   java.lang.IllegalAccessException:无法设置static final boolean   字段javax.crypto.JceSecurity.isRestricted到java.lang.Boolean
  org / jruby / RubyKernel.java:940:require'
C:/Users/username/Desktop/jruby-getting-started/config/application.rb:1:in
&#39;
  org / jruby / RubyKernel.java:940:require'
C:/Users/username/Desktop/jruby-getting-started/rakefile:1:in
&#39;
  org / jruby / RubyKernel.java:958:in load'
C:/Users/username/Desktop/jruby-getting-started/rakefile:4:in
(root)&#39;
  C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:1:在load_rakefile中的(root)'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:28:in
块中&#39;
  C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:694:在   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&#39;
  C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:182:在   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&#39;
  C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:83:在   run'
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:182:in
&#39;
  org / jruby / RubyKernel.java:958:in load' bin\rake:17:in&#39;

我也跟着this tutorial,我得到了一个&#34; rake aborted!&#34;相关的错误。这一个:

  耙子中止了!
  LoadError:无法加载此类文件 - 2.2 / pg_ext
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:在   require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:in
救助&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:3:在   <top (required)>'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
需要&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:在   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
各&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:在   block in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
各&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:在   require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
需要&#39;
  C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:在   <top (required)>'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
需要&#39;
  C:/ Users / username / Desktop / ruby​​-getting-started / Rakefile:4:<top (required)>'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
加载&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:在   load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
raw_load_rakefile&#39;
  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&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:在   load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
阻止   运行&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:在   standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
运行&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:在   <top (required)>'
C:/tools/ruby22/bin/rake:23:in
负载&#39;
  C:/ tools / ruby​​22 / bin / rake:23:<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
需要&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:4:在   <top (required)>'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
需要&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:在   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
各&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:在   block in require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
各&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:在   require'
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
需要&#39;
  C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:在   <top (required)>'
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
需要&#39;
  C:/ Users / username / Desktop / ruby​​-getting-started / Rakefile:4:<top (required)>'
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
加载&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:在   load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
raw_load_rakefile&#39;
  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&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:在   load_rakefile'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
阻止   运行&#39;
  C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:在   standard_exception_handling'
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
运行&#39;
  C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:在   <top (required)>'
C:/tools/ruby22/bin/rake:23:in
负载&#39;
  C:/ tools / ruby​​22 / bin / rake:23:在`&#39;

提前感谢您的答案/解决方案。

修改
我在Windows 10.这个问题,解决了这里找到的答案: I get a pg error when trying to destroy a controller

然后,出现了另一个问题,解决了这里找到的答案: PG::ConnectionBad FATAL: role “Myname” does not exist

然后,出现了另一个问题,解决了这里找到的答案: Resolving TZInfo::DataSourceNotFound Errors

然后,当尝试通过此命令在本地运行应用程序时,出现了另一个问题:
heroku local

  

[OKAY]加载ENV .env文件为KEY = VALUE格式
  下午3:44:09 web.1 |错误:JRuby或Windows上不支持工作模式   [DONE]使用信号null将所有进程杀死3:44:09 PM web.1退出退出代码1

我通过在根目录中添加 Procfile.windows 文件(修改为:web: ruby -S puma -t 5:5 -p %PORT% -e development)来阅读上述第二个教程的建议。

然后,当尝试通过此命令在本地运行应用程序时,出现了另一个问题:
heroku local web -f Procfile.windows

  

[OKAY]加载ENV .env文件为KEY = VALUE格式3:55:01 PM web.1 |   C:/程序   文件/ Heroku的/红宝石-2.1.7 / lib中/红宝石/ 2.1.0 /的rubygems / dependency.rb:298:在   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&#39;下午3:55:01 web.1 |来自C:/ Program   文件/ Heroku的/红宝石-2.1.7 / lib中/红宝石/ 2.1.0 /的rubygems / core_ext / kernel_gem.rb:53:在   gem' 3:55:01 PM web.1 | from C:/tools/ruby22/bin/puma:22:in &#39;下午3:55:01 web.1退出退出代码1

到目前为止,我无法找到解决方案。似乎问题在于Heroku在内部使用了另一个版本的Ruby(如上所示是v2.1.7版本,而不是其他地方安装的v2.2.4),它不包含名为&#34的宝石; PUMA&#34;

1 个答案:

答案 0 :(得分:0)

关于您的原始问题,您可能需要将Unlimited JCE安装到本地JDK中。你可以在这里下载它们: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html