我已经在现有的Rails红宝石项目中安装了所有宝石。但是,当我尝试运行该应用程序时,它总是抱怨以下内容。
efuturess-mbp:Actionrev-average-costing efutures$ rails c
Your Ruby version is 2.3.7, but your Gemfile specified 2.3.5
efuturess-mbp:Actionrev-average-costing efutures$ rbenv install 2.3.5
rbenv: /Users/efutures/.rbenv/versions/2.3.5 already exists
continue with installation? (y/N)
这是我的GEM文件。
source "https://rubygems.org"
ruby "2.3.5"
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem "RedCloth", "~> 4.2.9"
gem "active_shipping", "~> 1.7"
gem "activerecord-import"
gem "apartment"
gem "carrierwave"
gem "email_validator"
gem "flutie"
gem "googlecharts", "~> 1.6.8"
gem "mini_magick", "~> 3.8.1"
gem "mysql2", "~> 0.3.21"
gem "neat", "~> 2.1.0"
gem "net-ssh"
gem "normalize-rails", "~> 3.0.0"
gem "omniauth-stripe-connect", "~> 2.9"
gem "pikaday-gem"
gem "pothoven-attachment_fu"
gem "prawn"
gem "prawn-table"
gem "puma_worker_killer"
gem "rack-cors", require: "rack/cors"
gem "rack-mini-profiler", "~> 0.10.1"
gem "rack-rewrite", "~> 1.5"
gem "rails", "~> 5.1.5"
gem "recipient_interceptor"
gem "rollbar", "~> 2.12"
gem "simple_form", "~> 3.2"
gem "stripe", "~> 1.41"
gem "sucker_punch"
gem "will_paginate", "~> 3.0.7"
gem "xmlrpc"
gem "bootstrap-sass"
gem "coffee-rails", "~> 4.2"
gem "fog", require: "fog/aws/storage"
gem "fog-aws", "<= 0.1.1", require: false
gem "jbuilder", "~> 2.5"
gem "jquery-rails"
gem "jquery-ui-rails"
gem "memory_profiler"
gem "puma", "~> 3.7"
gem "rails-jquery-autocomplete"
gem "record_tag_helper", "~> 1.0"
gem "sass-rails", "~> 5.0"
gem "therubyracer", platforms: :ruby
gem "uglifier", ">= 1.3.0"
gem "bootstrap-datepicker-rails"
gem "american_date"
我不知道为什么会这样发生。如果有人可以帮助我解决这个问题,那将真的很有帮助。
答案 0 :(得分:0)
错误消息中非常清楚。您的问题是您当前的红宝石版本为2.3.7
,而您的项目使用的版本为2.3.5
,这会引起冲突。您可以尝试在项目目录中添加名为.ruby-version
的文件,以便rbenv
知道并自动在版本之间切换,或者建议您安装一个(如果尚未安装的话)。
# In file .ruby-version
2.3.5
详细了解here。
答案 1 :(得分:0)
这应该对您有帮助
echo '2.3.5' > .ruby-version
rbenv rehash
rbenv local 2.3.5
rbenv global 2.3.5
bundle exec rails c