我为自己设定了在本地 mac book air lion 开发环境中将我的应用程序从 rails 3.1 升级到 rails 3.2.6 的任务。我按照本指南升级了 ruby,我的所有 gem 似乎都已安装,并且 rails -v 给出了 rails 3.2.6 的答案。如果我运行任何 rails 命令,例如 rails c 来启动控制台,我会得到:
MacBook-Air:myapp bob$ rails c
/Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/pubnub-ruby-0.0.9/lib/pubnub-ruby.rb:1:in `require': cannot load such file -- ./pubnub.rb (LoadError)
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/pubnub-ruby-0.0.9/lib/pubnub-ruby.rb:1:in `<top (required)>'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/bob/work/myapp/config/application.rb:13:in `<top (required)>'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/railties-3.2.6/lib/rails/commands.rb:39:in `require'
from /Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/railties-3.2.6/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
是的,我确实在我的应用程序中使用了 pubnub - 它一直运行良好,所以我不怀疑这一定是问题所在。
application.rb 第 13 行(可能不相关)是
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
我在部署之前预编译资产。
/Users/bob/.rvm/gems/ruby-1.9.3-p0@rails32/gems/pubnub-ruby-0.0.9/lib/pubnub-ruby.rb:1 文件存在,我打开它很好。
有谁知道发生了什么/是pubnub特定的还是其他的?我不确定如何进一步排除故障,到目前为止,谷歌搜索还没有提出任何问题。
谢谢,
戴夫