[英]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.