【问题标题】:Rails server readline error when including Guard gem包含 Guard gem 时 Rails 服务器 readline 错误
【发布时间】:2013-03-10 10:27:17
【问题描述】:

我已经捆绑安装了以下 gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.12'

group :development, :test do
  gem 'sqlite3'
  gem 'rspec-rails', '2.11.0'
  gem 'guard-rspec', '1.2.1'
  gem 'guard-spork', '1.2.0'
  gem 'spork', '0.9.2'
end

group :production do
  gem 'pg'
end

group :test do
  gem 'capybara', '1.1.2'
  gem 'rb-inotify', '~> 0.9'
  gem 'libnotify', '0.5.9'
end

group :assets do
  gem 'sass-rails',   '~> 3.2.5'
  gem 'coffee-rails', '~> 3.2.2'
  gem 'uglifier', '>= 1.2.3'
end

gem 'jquery-rails'

当我在终端启动 rails 服务器时,出现以下错误:

steven@steven-VirtualBox:~/Dev/test_app$ rails s

您正在运行一个不支持 Readline 的 ruby​​ 版本

gem install rb-readline 或重新编译 ruby​​ --with-readline。

我已尝试按照控制台说明安装 readline,但我得到了同样的错误。我发现如果我删除了guard-rspec 和guard-spork,rails 服务器可以正常启动。这是我正在运行的内容:

  • ubuntu 12.10
  • 红宝石 2.0.0
  • 导轨 3.2.12
  • guard-rspec 1.2.1
  • guard-spork 1.2.0
  • spork 0.9.2

感谢您的帮助。

【问题讨论】:

    标签: ruby-on-rails readline guard spork


    【解决方案1】:

    似乎 ruby​​ 2.0 不支持 readline,因为它仍然很新(距离发布不到一个月)我建议现在使用 1.9.3 版本。查看guard-spork 文档的https://github.com/guard/guard-spork 和guard-rspec 文档https://github.com/guard/guard-rspec。它说它已针对 1.8.7、1.9.2 和 1.9.3 进行了测试。

    【讨论】:

      【解决方案2】:

      基于此:wrapping 0.5.0 release,他们似乎正在准备一个新版本来支持ruby 2.0,同时你可以试试这个:

      git clone https://github.com/luislavena/rb-readline.git
      cd rb-readline
      rake install
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多