我正在使用JRuby,因爲它對於Windows上的SRS Ruby on Rails更好。無法訪問Windows中的Rails控制檯 - LoadError
我的解決方案是在cmd.exe或Powershell(不是gitbash)中使用jirb
。
我已經試過:
$ rails console
Loading development environment (Rails 4.2.4)
Switch to inspect mode.
LoadError: load error: rails/commands -- java.lang.UnsatisfiedLinkError: The operation completed successfully.
require at org/jruby/RubyKernel.java:939
<top> at bin/rails:4
和:
$ bundle exec rails console
uri:classloader:/jruby/kernel/kernel.rb:17: warning: unsupported exec option: close_others
Loading development environment (Rails 4.2.4)
Switch to inspect mode.
LoadError: load error: rails/commands -- java.lang.UnsatisfiedLinkError: The operation completed successfully.
require at org/jruby/RubyKernel.java:939
<top> at bin/rails:4
和:
$ jruby.exe -S bundle exec rails console
uri:classloader:/jruby/kernel/kernel.rb:17: warning: unsupported exec option: close_others
Loading development environment (Rails 4.2.4)
Switch to inspect mode.
LoadError: load error: rails/commands -- java.lang.UnsatisfiedLinkError: The operation completed successfully.
require at org/jruby/RubyKernel.java:939
<top> at bin/rails:4
我試圖解決 「Load error when running rails console」,但在重新啓動電腦有沒有影響。 bin/spring沒有提及GEM_HOME
。我重新安裝了Rails和Spring。
這是因爲JRuby?
我覺得jruby -S rails console
需要C擴展。我發現了另一種使用JRuby自己的jirc訪問控制檯的方法。我開始:
$ jirb
Switch to inspect mode.
然後編輯〜/ .irbrc包括
IRB.conf[:PROMPT_MODE] = :SIMPLE
它生產:
$ jirb
Switch to inspect mode.
>>
然後立即退出。這樣做:
$ jirb puts 'hello'
Switch to inspect mode.
Errno::ENOENT: No such file or directory - puts
initialize at org/jruby/RubyFile.java:342
open at org/jruby/RubyIO.java:1124
open at G:/jruby-9.0.1.0/lib/ruby/stdlib/irb/magic-file.rb:7
initialize at G:/jruby-9.0.1.0/lib/ruby/stdlib/irb/input-method.rb:100
initialize at G:/jruby-9.0.1.0/lib/ruby/stdlib/irb/context.rb:84
initialize at G:/jruby-9.0.1.0/lib/ruby/stdlib/irb.rb:426
start at G:/jruby-9.0.1.0/lib/ruby/stdlib/irb.rb:381
<top> at G:/jruby-9.0.1.0/bin/jirb:13
由於我的控制檯仍然沒有工作,沒有什麼關於jirc使用C擴展,這個問題是不是重複那一個。
OSX或Linux系統? –
Windows使用jruby 9.0.1.0 –
[JRuby無法正常工作的Rails應用程序的可能的重複](http://stackoverflow.com/questions/21051052/rails-app-with-jruby-not-working) –