在Ruby on Rails新项目中运行bundle install

时间:2023-01-17 09:41:14

I'm learning Ruby on Rails with Lynda.com. In one of the early videos, the instructor creates a new project using the command

我正在和Lynda.com一起学习Ruby on Rails。在其中一个早期视频中,教师使用该命令创建一个新项目

rails new simple_cms -d mysql

After he ran that, he got some output like this, which I also got, but at the bottom of mine, I saw "run bundle install". His doesn't have that...

在他运行之后,他得到了一些这样的输出,我也得到了,但在我的底部,我看到“运行捆绑安装”。他没有......

Is that a command I'm supposed to run?

那是我应该跑的命令吗?

   create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install

4 个解决方案

#1


31  

You first need to install the bundler gem:

首先需要安装bundler gem:

gem install bundler

Once it's done, run:

完成后,运行:

bundle

or:

bundle install

(same thing)

#2


7  

Bundler is a gem dependency manager. It ensures that all the gems you use (chunks of third party code) have their dependencies (other gems that they rely on) satisfied.

Bundler是一个gem依赖管理器。它确保您使用的所有宝石(第三方代码块)都具有满足的依赖关系(他们依赖的其他宝石)。

You should run bundle install, as this installs all the gems Rails will need to get going.

你应该运行bundle install,因为这将安装Rails需要的所有宝石。

The video you're watching probably concerns an old version of Rails. The current version (by that I mean version 3 and above) uses Bundler by default. Versions lower than 3 did not ship with Bundler support.

您正在观看的视频可能与旧版本的Rails有关。当前版本(我的意思是版本3及更高版本)默认使用Bundler。 Bundler支持不附带低于3的版本。

The fantastic Ryan Bates has a bit more on Bundler, and loads of stuff on Rails 3.

精彩的Ryan Bates在Bundler上有更多的东西,在Rails 3上有很多东西。

#3


0  

This issue caught me off guard. However, I was ultimately at fault. I had created a shell alias of rails="bundle exec rails" And I had forgotten about this, as it served to make working with my other projects easier. However, the "rails new" command is incompatible with such an alias. D'oh.

这个问题让我措手不及。但是,我最终有过错。我创建了一个rails别名为rails =“bundle exec rails”而且我已经忘记了这一点,因为它有助于更​​轻松地处理我的其他项目。但是,“rails new”命令与此类别名不兼容。 D'哦。

#4


0  

To make this work, you have to run gem install bundler first. This will install your bundler, that you need to install gems with bundle install. More info about this topic here.

要使其工作,您必须首先运行gem install bundler。这将安装您的捆绑包,您需要安装捆绑安装宝石。这里有关于此主题的更多信息。

#1


31  

You first need to install the bundler gem:

首先需要安装bundler gem:

gem install bundler

Once it's done, run:

完成后,运行:

bundle

or:

bundle install

(same thing)

#2


7  

Bundler is a gem dependency manager. It ensures that all the gems you use (chunks of third party code) have their dependencies (other gems that they rely on) satisfied.

Bundler是一个gem依赖管理器。它确保您使用的所有宝石(第三方代码块)都具有满足的依赖关系(他们依赖的其他宝石)。

You should run bundle install, as this installs all the gems Rails will need to get going.

你应该运行bundle install,因为这将安装Rails需要的所有宝石。

The video you're watching probably concerns an old version of Rails. The current version (by that I mean version 3 and above) uses Bundler by default. Versions lower than 3 did not ship with Bundler support.

您正在观看的视频可能与旧版本的Rails有关。当前版本(我的意思是版本3及更高版本)默认使用Bundler。 Bundler支持不附带低于3的版本。

The fantastic Ryan Bates has a bit more on Bundler, and loads of stuff on Rails 3.

精彩的Ryan Bates在Bundler上有更多的东西,在Rails 3上有很多东西。

#3


0  

This issue caught me off guard. However, I was ultimately at fault. I had created a shell alias of rails="bundle exec rails" And I had forgotten about this, as it served to make working with my other projects easier. However, the "rails new" command is incompatible with such an alias. D'oh.

这个问题让我措手不及。但是,我最终有过错。我创建了一个rails别名为rails =“bundle exec rails”而且我已经忘记了这一点,因为它有助于更​​轻松地处理我的其他项目。但是,“rails new”命令与此类别名不兼容。 D'哦。

#4


0  

To make this work, you have to run gem install bundler first. This will install your bundler, that you need to install gems with bundle install. More info about this topic here.

要使其工作,您必须首先运行gem install bundler。这将安装您的捆绑包,您需要安装捆绑安装宝石。这里有关于此主题的更多信息。