我正在关注"使用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'
&#39;
C:/Users/username/Desktop/jruby-getting-started/config/application.rb:1:in
org / jruby / RubyKernel.java:940:require'
&#39;
C:/Users/username/Desktop/jruby-getting-started/rakefile:1:in
org / jruby / RubyKernel.java:958:inload'
(root)&#39;
C:/Users/username/Desktop/jruby-getting-started/rakefile:4:in
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:1:在load_rakefile中的(root)'
块中&#39;
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/rake_module.rb:28:in
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:694:在raw_load_rakefile'
load_rakefile&#39;
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:100:in
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'
load_rakefile&#39;
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:99:in
C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/rake-10.4.0/lib/rake/application.rb:83:在run'
&#39;
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:inload' 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'
救助&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:10:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:3:在<top (required)>'
需要&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:在block (2 levels) in require'
各&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:在block in require'
各&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:在require'
需要&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:在<top (required)>'
需要&#39;
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
C:/ Users / username / Desktop / ruby-getting-started / Rakefile:4:<top (required)>'
加载&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:在load_rakefile'
raw_load_rakefile&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:94:inblock in load_rakefile'
standard_exception_handling&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:在load_rakefile'
阻止 运行&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:在standard_exception_handling'
运行&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:在<top (required)>'
负载&#39;
C:/tools/ruby22/bin/rake:23:in
C:/ tools / ruby22 / bin / rake:23:<main>'
需要&#39;
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
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/pg-0.17.1-x86-mingw32/lib/pg.rb:4:在<top (required)>'
需要&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:在block (2 levels) in require'
各&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:在block in require'
各&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:在require'
需要&#39;
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in
C:/Users/username/Desktop/ruby-getting-started/config/application.rb:7:在<top (required)>'
需要&#39;
C:/Users/username/Desktop/ruby-getting-started/Rakefile:4:in
C:/ Users / username / Desktop / ruby-getting-started / Rakefile:4:<top (required)>'
加载&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/rake_module.rb:28:在load_rakefile'
raw_load_rakefile&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:689:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:94:inblock in load_rakefile'
standard_exception_handling&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:93:在load_rakefile'
阻止 运行&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:77:in
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:176:在standard_exception_handling'
运行&#39;
C:/tools/ruby22/lib/ruby/2.2.0/rake/application.rb:75:in
C:/tools/ruby22/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:在<top (required)>'
负载&#39;
C:/tools/ruby22/bin/rake:23:in
C:/ tools / ruby22 / 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;
答案 0 :(得分:0)
关于您的原始问题,您可能需要将Unlimited JCE安装到本地JDK中。你可以在这里下载它们: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html