简体   繁体   English

在Windows命令提示符下在Rails项目中启动新的ruby问题

[英]Problems in starting a new ruby on rails project in windows command prompt

I just installed ruby on rails using railsinstaller on windows 7. I can start rails using a command prompt. 我只是在Windows 7上使用railsinstaller在ruby上安装了ruby。我可以使用命令提示符启动rails。 But when I start a new project, this is what I get: 但是,当我开始一个新项目时,这就是我得到的:

C:\Sites>rails new first_cms -d mysql
  create
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  create  app/assets/javascripts/application.js
  create  app/assets/stylesheets/application.css
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  app/views/layouts/application.html.erb
  create  app/assets/images/.keep
  create  app/mailers/.keep
  create  app/models/.keep
  create  app/controllers/concerns/.keep
  create  app/models/concerns/.keep
  create  bin
  create  bin/bundle
  create  bin/rails
  create  bin/rake
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/secrets.yml
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/cookies_serializer.rb
  create  config/initializers/filter_parameter_logging.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/session_store.rb
  create  config/initializers/wrap_parameters.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  lib
  create  lib/tasks
  create  lib/tasks/.keep
  create  lib/assets
  create  lib/assets/.keep
  create  log
  create  log/.keep
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/robots.txt
  create  test/fixtures
  create  test/fixtures/.keep
  create  test/controllers
  create  test/controllers/.keep
  create  test/mailers
  create  test/mailers/.keep
  create  test/models
  create  test/models/.keep
  create  test/helpers
  create  test/helpers/.keep
  create  test/integration
  create  test/integration/.keep
  create  test/test_helper.rb
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  create  vendor/assets/javascripts/.keep
  create  vendor/assets/stylesheets
  create  vendor/assets/stylesheets/.keep
     run  bundle install

At this point, the command prompt just stops working. 此时,命令提示符刚刚停止工作。 When I check the directory I notice that the new project files have already been created, though. 当我检查目录时,我注意到新的项目文件已经创建。 My ruby and rails information are as follows 我的红宝石和铁轨信息如下

ruby:
bin:        C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
version:    ruby 1.9.3p545 (2014-02-24) [i386-mingw32]

rails:
bin:        C:/RailsInstaller/Ruby1.9.3/bin/rails.bat
version:    Rails 4.1.1 

Why is the progress of the project stuck at 'run bundle install'? 为什么项目进度会停留在“运行捆绑包安装”中? I'm totally new to rails so this is something confusing to me. 我对Rails完全陌生,所以这让我感到困惑。

How long have you been waiting? 你等了多久了? Bundler calls out to rubygems.org to install missing gems so it can sometimes take a minute on a freshly-created app. Bundler呼吁rubygems.org安装缺少的宝石,因此有时在新创建的应用上可能需要一分钟。

It might be your connection as they said here, but it also can be something different. 就像他们在这里所说的那样,可能是您的联系,但也可能有所不同。 Sometimes, I got an error when I create a new rails projects exactly at the "run bundle install" moment. 有时,恰好在“运行捆绑安装”时刻创建新的Rails项目时出现错误。 If the problem persists, you can try the way I did. 如果问题仍然存在,您可以尝试按照我的方法。

You can go to your project folder by typing: 您可以通过键入以下内容转到项目文件夹:
cd first_cms

And then you can install bundle manually: 然后您可以手动安装捆绑软件:
gem install bundle

Then, you can run the bundle and the project creation will be finished: 然后,您可以运行捆绑包,项目创建将完成:
bundle install

It worked for me! 它为我工作! Hope it works for you 希望这对你有用

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM