我遇到了rails控制台的问题。当我尝试使用以下方法安装readline模块时,它给出了这个错误:
yum install readline-devel
我在fedora 14机器上使用Rails 3.1.1。
/home/led/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
from /home/led/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `require'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `require'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
此外:
我尝试在此链接后通过rvm安装readline [readline install via rvm] [1]
和rails c工作但问题是重新启动我的系统并再次尝试它似乎显示此错误
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rack (~> 1.2.1) amongst [ParseTree-3.0.5, RubyInline-3.8.4, ZenTest-4.3.3, abstract-1.0.0, actionmailer-3.0.5, actionpack-3.0.5, activemodel-3.0.5, activerecord-3.0.5, activeresource-3.0.5, activesupport-3.0.5, arel-2.0.9, builder-2.1.2, bundler-1.0.10, cgi_multipart_eof_fix-2.5.0, daemons-1.0.10, diff-lcs-1.1.2, erubis-2.6.6, fastthread-1.0.7, gem_plugin-0.2.3, git-1.2.5, i18n-0.6.0, i18n-0.5.0, json-1.4.6, mail-2.3.0, mime-types-1.17.2, mime-types-1.16, mongrel-1.1.5, mongrel_cluster-1.0.5, multimap-1.1.2, mysql-2.8.1, mysql2-0.3.7, polyglot-0.3.2, polyglot-0.3.1, rack-1.3.5, rack-1.1.0, rack-mount-0.8.3, rack-mount-0.6.13, rack-test-0.6.1, rack-test-0.5.4, rails-3.0.5, railties-3.0.5, rake-0.9.2.2, rake-0.9.2, regin-0.3.8, regin-0.3.7, rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, ruby2ruby-1.2.4, ruby_parser-2.0.4, sexp_processor-3.0.4, sqlite3-1.3.3, text-format-1.0.0, thor-0.14.6, treetop-1.4.10, treetop-1.4.9, tzinfo-0.3.30, tzinfo-0.3.26] (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:742:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:764:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:742:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1211:in `gem'
from /usr/bin/rails:18
答案 0 :(得分:0)
您需要安装readline标头和库之前安装Ruby解释器(一旦完成RVM安装就会显示)
您可以再次看到rvm notes
答案 1 :(得分:0)
检查是否已安装readline gem。上面的yum命令安装了readline库,但要与它进行交互,你需要gem。
如果它不在您的Gemfile中,请添加它,运行bundle install并再次检查。