在博客文件夹中运行rails服务器(我也在博客文件夹中成功安装了所需的软件包)我收到此错误:
/usr/lib/ruby/vendor_ruby/bundler/resolver.rb:423:in `block in error_message': undefined method `>' for < 2.0, >= 1.3.0:Gem::Requirement (NoMethodError)
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:410:in `each'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:410:in `inject'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:410:in `error_message'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:391:in `version_conflict'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:129:in `block in resolve'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:127:in `catch'
from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:127:in `resolve'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:151:in `resolve'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:90:in `specs'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:135:in `specs_for'
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:124:in `requested_specs'
from /usr/lib/ruby/vendor_ruby/bundler/environment.rb:23:in `requested_specs'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:11:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:7:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ayush/Rails/blog/config/boot.rb:4:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
继承Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster.
gem 'turbolinks'
# Build JSON APIs with ease.
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
的boot.rb
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
请指出我出错的地方。我也是这个论坛的新手,所以如果我在发布问题时做错了请告诉我。 顺便说一句,我正在使用ubuntu终端。 我正在使用
Rails 4.0.0
ruby 1.9.3p0(2011-10-30修订版33570)[x86_64-linux]
我的数据库的Mysql2
在我敲打头的那些日子里,我认为它是由于红宝石和导轨不兼容......谁能告诉我如何解决这个问题?
答案 0 :(得分:0)
我终于解决了。
rails和ruby的兼容性有一些错误,我通过完全删除ruby1.8版本解决了这个问题,因为它以某种方式手动选择它。