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