所以我感到非常沮丧。我正在做 www.railstutorial.org,他们需要一个非常特定的 Rails 版本(4.2.2)。我已经按照他们的要求安装了。将他们的 Gemfile 规范放入他们提供的“hello_app”应用程序中。当我运行“rails server”时,我收到一条错误消息,指出“byebug”出错。我尝试安装早期和更高版本的 bye bug,但收到相同的错误消息。有人可以帮帮我吗?我感觉很失落。
教程位于下面的网址。
https://www.railstutorial.org/book/beginning#code-hello_action
alopex@alopex-TH55-HD:~/workspace/hello_app$ more Gemfile
source 'https://rubygems.org
gem 'rails', '4.2.2'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
alopex@alopex-TH55-HD:~/workspace/hello_app$ bundle install
Gem::InstallError: byebug requires Ruby version >= 2.0.0.
An error occurred while installing byebug (3.4.0), and Bundler cannot continue.
Make sure that `gem install byebug -v '3.4.0'` succeeds before bundling.
alopex@alopex-TH55-HD:~/workspace/hello_app$ sudo gem install byebug -v 3.4.0
ERROR: Error installing byebug:
byebug requires Ruby version >= 2.0.0.
最佳答案
我通过以下方式解决了这个问题:
- 打开应用程序的 Gemfile
- 删除:
gem 'byebug'
- 将其替换为:
gem 'pry-byebug',平台:[:ruby_20]
关于server - 需要帮助让 Rails 服务器正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31304819/