我上的Zed Shaw的工作學習Ruby的堅硬方式行使25要求命令不bash的IRB內工作雪豹
http://ruby.learncodethehardway.org/ex25.html
,當我瀏覽到包含ruby文件ex25.rb的目錄和推出IRB,我得到這些錯誤:
Larson-2:~ larson$ cd Ruby
Larson-2:Ruby larson$ ls
ex25.rb
Larson-2:Ruby larson$ irb
ruby-1.9.2-p290 :001 > require 'ex25'
LoadError: no such file to load -- ex25
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :002 >
看來,需要命令不能在這裏工作。有什麼我失蹤?
我也試圖要求」 ./25' 的建議,並得到這些錯誤:
Larson-2:Ruby larson$ irb
ruby-1.9.2-p290 :001 > require './ex25'
SyntaxError: /Users/larson/Ruby/ex25.rb:1: invalid multibyte char (US-ASCII)
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
那麼,這是一個不同的錯誤消息,所以一個不同的問題。這有幫助嗎? http://stackoverflow.com/questions/1739836/invalid-multibyte-char-us-ascii-with-ruby-on-rails – Mischa
僅供參考後者錯誤是由於該文件編碼爲UTF-16而引起的。一旦它變成UTF-8,他們就離開了。 –