Ruby,Rails控制台以错误开始...需要帮助

时间:2011-08-09 05:11:54

标签: ruby-on-rails ruby

> luke@Macbook-Pro~/Documents/workspace/RoR/rails_projects/sample4_app$ ruby -v

ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]
luke@Macbook-Pro~/Documents/workspace/RoR/rails_projects/sample4_app$ rails -v

Rails 3.0.9

luke@Macbook-Pro~/Documents/workspace/RoR/rails_projects/sample4_app$ rails console


/Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i686-darwin10.8.0/readline.bundle: dlopen(/Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i686-darwin10.8.0/readline.bundle, 9): Symbol not found: _rl_basic_quote_characters (LoadError)
  Referenced from: /Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i686-darwin10.8.0/readline.bundle
  Expected in: flat namespace
 in /Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i686-darwin10.8.0/readline.bundle - /Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/i686-darwin10.8.0/readline.bundle
    from /Users/luke/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/completion.rb:10
    from /Users/luke/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.0.9/lib/rails/commands/console.rb:3:in `require'
    from /Users/luke/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.0.9/lib/rails/commands/console.rb:3
    from /Users/luke/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.0.9/lib/rails/commands.rb:20:in `require'
    from /Users/luke/.rvm/gems/ruby-1.8.7-p352/gems/railties-3.0.9/lib/rails/commands.rb:20
    from script/rails:6:in `require'
    from script/rails:6

Ruby没关系,Rails没问题,但是“rails console” 需要帮忙 感谢

2 个答案:

答案 0 :(得分:0)

看起来你错过了ruby版本中的文件。你刚刚更新到OS X 10.7吗?您可能需要重新安装Rails。一如既往,这可以通过以下方式完成:

sudo gem install rails

抱歉,我无法提供更多帮助。

答案 1 :(得分:-1)

建议使用bundler来管理项目中的gem。

如果你把

 source 'http://rubygems.org'

 gem 'rails', '3.0.9'
Gemfile中的

(另请参阅http://gembundler.com/

然后

 bundle install

将安装正确版本的rails和

 bundle exec rails console 

将启动您的控制台。 bundle exec rails server将启动服务器等。

您可能还想考虑使用rvm来安装和管理您的红宝石(如果您还没有) - http://beginrescueend.com/