简体   繁体   English

为什么在运行捆绑软件时Rails安装新版本?

[英]Why is rails installing a newer version when I run bundle?

I am trying to start a new rails project and I would like to stick with rails 3.1.3. 我正在尝试启动一个新的Rails项目,我想坚持使用Rails 3.1.3。 However, when I run the command rails new projectname I get the following output: 但是,当我运行命令rails new projectname我得到以下输出:

  create  
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  ...
  create  config
  ...
  create  config/database.yml
  create  db
  ...
  create  public/robots.txt
  create  script
  create  script/rails
  create  test/fixtures
  create  test/fixtures/.gitkeep
  ...
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  ...
  create  vendor/plugins/.gitkeep
     run  bundle install
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.0.4) 
Using activesupport (3.2.0.rc2) 
Using builder (3.0.0) 
Using activemodel (3.2.0.rc2) 
Using erubis (2.7.0) 
Using journey (1.0.0) 
Using rack (1.4.0) 
Using rack-cache (1.1) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.2.0.rc2) 
Using mime-types (1.17.2) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.3.0) 
Using actionmailer (3.2.0.rc2) 
Using arel (3.0.0) 
Using tzinfo (0.3.31) 
Using activerecord (3.2.0.rc2) 
Using activeresource (3.2.0.rc2) 
Using bundler (1.0.21) 
Using coffee-script-source (1.2.0) 
Using execjs (1.2.13) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.5) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.0.rc2) 
Using coffee-rails (3.2.1) 
Using jquery-rails (2.0.0) 
Installing rails (3.2.0.rc2)           # WTF?
Using sass (3.1.12) 
Using sass-rails (3.2.3) 
Using sqlite3 (1.3.5) 
Using uglifier (1.2.2) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

I'd like everything to remain version 3.1. 我希望所有内容都保持版本3.1。 Why does the rails command automatically update itself to 3.2.0.rc2? 为什么rails命令会自动将自身更新为3.2.0.rc2? How can I make sure that everything I do is using 3.1.3 versions of everything? 如何确保我所做的所有事情都使用3.1.3版本?

Thanks. 谢谢。

It is relatively little known fact that you can specify the rails version for a new application _like.this_ 可以为新应用程序_like.this_指定rails版本的信息鲜为人知。

rails _3.1.3_ projectname

will work assuming 3.1.3 is installed (gem install rails -v3.1.3 otherwise) 在安装了3.1.3的情况下可以正常工作(否则,请在gem install rails -v3.1.3上安装)

This also works with rails 2 apps, ie pre-bundler and will create a rails2 looking application in these cases, eg rails _2.3.8_ projectname Again gem install rails -v2.3.8 if necessary (ie first time usage on that machine). 这也适用于rails 2应用程序(即pre-bundler),并且在这些情况下将创建具有rails2外观的应用程序,例如rails _2.3.8_ projectname再次在必要时gem install rails -v2.3.8 (即在该机器上的首次使用)。

Longer term make sure you are using rvm (now a defacto standard) and you can use that toset your default rails (as well as ruby). 从长远来看,请确保您使用的是rvm(现在是事实上的标准),并且可以使用它来设置默认的rails(以及ruby)。

Removing the old version can be done with sudo gem uninstall rails -v 3.2.0.rc2 可以使用sudo gem uninstall rails -v 3.2.0.rc2删除旧版本。

暂无
暂无

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

相关问题 在Rails项目中安装捆绑软件时,Ruby版本不正确 - Incorrect ruby version when installing bundle in rails project 在Rails中,为什么在没有运行包或包安装的情况下有一个新的Gemfile.lock? (以及新的Gemfile时间戳) - In Rails, why there is a new Gemfile.lock when no bundle or bundle install was run? (and a new Gemfile timestamp too) 如何将现有的旧rails项目更新为更新版本 - How do I update an existing older rails project to a newer version 重新安装ruby后运行“捆绑安装”时收到bash错误消息 - I get a bash error message when I run “bundle install” after re-installing ruby 运行“捆绑安装”而不安装特定的依赖宝石-Rails - Run “Bundle Install” w/o Installing a Specific Dependency Gem - Rails Ruby on Rails 5; 捆绑安装时如何停止安装与gem相关的文件 - Ruby on rails 5; How to stop installing gem related files when I bundle install 当我尝试在Rails中运行命令时,我不断收到错误消息(捆绑安装,Rails服务器等) - When I try to run commands in rails, I keep getting an error (bundle install, rails server, etc) 当我在导轨上安装 ruby 后检查导轨版本时,我收到以下消息: - When I check the version of rails after installing ruby on rails I get this message: 安装Rails时为什么会出现OpenSSL :: SSL :: SSLError? - Why do I get OpenSSL::SSL::SSLError when installing Rails? 在Ruby / Rails / Aptana中安装捆绑软件时,此错误是什么? - What is this error when installing a bundle in Ruby/Rails/Aptana?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM