gpt4 book ai didi

ruby-on-rails - heroku Cedar 上的 CSV

转载 作者:数据小太阳 更新时间:2023-10-29 07:10:50 25 4
gpt4 key购买 nike

我想在 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>'

最佳答案

尝试

require 'csv'

区分大小写。

更新:请注意,这不是 Heroku 问题 - 如果您在本地执行相同的操作,您会得到相同的错误。 CSV 位于 Ruby 1.9 的标准库中。

关于ruby-on-rails - heroku Cedar 上的 CSV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9367697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com