2

运行“rails server”命令时出现以下错误。这是错误:

maruf@phoenix:/media/resource/RoR/project$ rails server
/usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:12:in `require': no such file to load -- /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/../lib/trace_nums19 (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:12:in `rescue in <module:TraceLineNumbers>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:8:in `<module:TraceLineNumbers>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/tracelines19.rb:6:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/linecache19.rb:69:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/bundler/gems/linecache19-0.5.13-c0804efc995a/lib/linecache19.rb:69:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /media/resource/RoR/project/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p320@project/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

这是宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2'
gem 'zclip-rails'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem "therubyracer"
  gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports   LESS
  gem "twitter-bootstrap-rails"
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews /linecache19-0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre10'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'

这是“gem list”命令的输出:

actionmailer (3.2.11)
actionpack (3.2.11)
activemodel (3.2.11)
activerecord (3.2.11)
activeresource (3.2.11)
activesupport (3.2.11)
archive-tar-minitar (0.5.2)
arel (3.0.2)
builder (3.0.4)
bundler (1.2.3)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
columnize (0.3.6)
commonjs (0.2.6)
debugger-linecache (1.1.2)
debugger-ruby_core_source (1.1.7)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.2.0)
json (1.7.6)
less (2.2.2)
less-rails (2.2.6)
libv8 (3.11.8.13 x86-linux)
linecache19 (0.5.12)
mail (2.4.4)
mime-types (1.19)
multi_json (1.5.0)
mysql2 (0.3.11)
polyglot (0.3.3)
rack (1.4.4)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.11)
railties (3.2.11)
rake (10.0.3)
rbx-require-relative (0.0.9)
rdoc (3.12)
ref (1.0.2)
ruby-debug-base19 (0.11.25)
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta16, 0.4.17.beta14)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
sass (3.2.5)
sass-rails (3.2.6)
sprockets (2.2.2)
therubyracer (0.11.3)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
twitter-bootstrap-rails (2.2.0)
tzinfo (0.3.35)
uglifier (1.3.0)
zclip-rails (0.0.1)

我在用

Rails 3.2.11 和 ruby​​ 1.9.2p320(2012-04-20 修订版 35421)[i686-linux]

我该如何解决这个问题来运行服务器?

4

2 回答 2

1

Gemfile 中列出的 linecache19 版本似乎比“gem list”显示的版本更新。您是否尝试过运行“捆绑更新”?

于 2013-01-26T16:06:13.957 回答
1

我通过将 trace_nums19.bundle 复制到它丢失的文件夹中解决了同样的问题。您可以在 linecache gem 的 lib 文件夹中的某个位置找到此文件

于 2013-02-04T02:48:54.250 回答