我想在heroku cedar上使用带有rails 3.2.1的CSV模块,但是
require 'CSV'不起作用
以下是使用控制台测试时的错误:
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>'发布于 2012-02-21 04:11:17
试一试
require 'csv'它区分大小写。
更新:这不是Heroku的问题,提醒你-如果你在本地做同样的事情,你会得到同样的错误。CSV位于Ruby1.9的标准库中。
https://stackoverflow.com/questions/9367697
复制相似问题