简体   繁体   English

您的Ruby版本是1.9.3,但是您的Gemfile指定了2.2.2

[英]Your Ruby version is 1.9.3, but your Gemfile specified 2.2.2

I keep getting a version error when trying to upload my code. 尝试上传代码时,我始终收到版本错误。 I have seen other posts but since I am workign from Cloud9 it seems those are not directing me correctly. 我看过其他帖子,但是由于我是Cloud9的工作人员,因此似乎无法正确地指导我。 Also when using the command "ruby -v" it shows 2.2.2 同样,当使用命令“ ruby​​ -v”时,它显示2.2.2

Gem file below: 宝石文件如下:

source 'https://rubygems.org'

ruby '2.2.2'
gem 'rails', '4.2.1'
# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

# for Heroku deployment - as described in Ap. A of ELLS book
group :development, :test do
  gem 'sqlite3'
  gem 'byebug'
  gem 'database_cleaner', '1.4.1'
  gem 'capybara', '2.4.4'
  gem 'launchy'
  gem 'rspec-rails', '3.3.2'
  gem 'ZenTest', '4.11.0'
end

group :test do
  gem 'cucumber-rails', :require => false
  gem 'cucumber-rails-training-wheels'
end
group :production do
  gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.

  #gem 'therubyracer', '~> 0.12.0'
gem 'sass-rails', '~> 5.0.3'
gem 'coffee-rails', '~> 4.1.0'
gem 'uglifier', '>= 2.7.1'

gem 'jquery-rails'
gem 'haml'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

https://docs.c9.io/docs/writing-a-ruby-app#rvm-support Currently, the default version is 1.9.3 https://docs.c9.io/docs/writing-a-ruby-app#rvm-support 当前,默认版本为1.9.3

So on the C9 console: 因此在C9控制台上:

rvm use 2.2.2

If that fails to find 2.2.2, I think you need to install it per project basis as mentioned towards the of that post. 如果找不到2.2.2,我认为您需要按照该帖子的说明在每个项目的基础上安装它。

curl -L https://get.rvm.io | bash -s stable

Alternately you can also have a project file called .ruby-version How to generate: 或者,您也可以有一个名为.ruby-version的项目文件。如何生成:

echo 2.2.2 > .ruby-version

RVM should respect this as well as rbenv if in future you use that locally More here: https://rvm.io/workflow/projects 如果将来您在本地使用RVM,则RVM应该同时尊重rbenv和更多信息: https ://rvm.io/workflow/projects

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您的Ruby版本是1.9.3,但是您的Gemfile指定了2.2.1 - Your Ruby version is 1.9.3, but your Gemfile specified 2.2.1 Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但您的Gemfile指定为2.0.0 - Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 您的 Ruby 版本是 1.9.3,但您的 Gemfile 指定了 2.1.0 - Your Ruby version is 1.9.3, but your Gemfile specified 2.1.0 如何修复“您的 Ruby 版本是 1.9.3,但您的 Gemfile 指定了 2.0.0” - How to fix "Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0" Rails服务器错误:Ruby版本是1.8.7,但您的Gemfile指定为1.9.3 - Rails Server Error: Ruby version is 1.8.7, but your Gemfile specified 1.9.3 “您的Ruby版本是1.9.3,但您的Gemfile指定为1.9.3-p194” - “Your Ruby version is 1.9.3, but your Gemfile specified 1.9.3-p194” 为什么会出现此错误您的Ruby版本是2.0.0,但是您的Gemfile指定了2.2.2 - Why do I get this error Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2 在RubyMine中:“您的Ruby版本是2.0.0,但是您的Gemfile指定了1.9.3(Bundler :: RubyVersionMismatch)” - In RubyMine: “Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)” 为什么我会收到错误“你的Ruby版本是2.0.0,但你的Gemfile指定为2.2.2”虽然我安装了2.2.2 - Why do I get the error “Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2” although I have 2.2.2 installed 您的Ruby版本是2.3.1,但是您的Gemfile指定了2.3.1(相同版本) - Your Ruby version is 2.3.1, but your Gemfile specified 2.3.1 (same version)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM