2012-02-20 30 views
5

Tôi muốn sử dụng các mô-đun CSV với đường ray 3.2.1 trên Heroku tuyết tùng, nhưngCSV trên Heroku Cedar

require 'CSV' 

không làm việc

đây là lỗi khi thử nghiệm với giao diện điều khiển:

Loading production environment (Rails 3.2.1) 
irb(main):001:0> require 'CSV' 
LoadError: no such file to load -- CSV 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require' 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require' 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require' 
    from (irb):1 
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start' 
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start' 
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
+0

Bạn đã thêm nó vào gói của mình và chạy cài đặt nhóm chưa? – Peterdk

Trả lời

13

thử

require 'csv' 

phân biệt chữ hoa chữ thường.

CẬP NHẬT: Đây không phải là vấn đề về Heroku mà bạn quan tâm - nếu bạn làm như vậy ở địa phương bạn sẽ nhận được cùng một lỗi. CSV nằm trong thư viện chuẩn trong Ruby 1.9.

+0

đơn giản đủ, cảm ơn, nó hoạt động trong trường hợp trên và thấp hơn trên máy địa phương của tôi, bất kỳ ý tưởng tại sao? – denisjacquemin

+0

tại địa phương nó hoạt động trong trường hợp trên quá – denisjacquemin

+0

bạn đang sử dụng 1.9.2 cục bộ? –

Các vấn đề liên quan