0

我刚开始一个名为图书馆管理系统的新项目。在运行 bundle install 时Windows XP 32 bit。我还在我的系统上安装了 Python 3.3。我收到以下错误。

    D:\Projects\Library>bundle install
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/
dsl.rb:7:in `instance_eval': D:/Projects/Library/Gemfile:27: syntax error, unexp
ected tDOT2, expecting $end (SyntaxError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/dsl.rb:7:in `evaluate'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/definition.rb:17:in `build'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler.rb:138:in `definition'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/cli.rb:219:in `install'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/task.rb:22:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor.rb:263:in `dispatch'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/vendor/thor/base.rb:386:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/bin/bundle:13:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in `load'
        from C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in `<main>'

我的Gemlock文件如下:-

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.11)
      actionpack (= 3.2.11)
      mail (~> 2.4.4)
    actionpack (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.11)
      activesupport (= 3.2.11)
      builder (~> 3.0.0)
    activerecord (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.11)
      activemodel (= 3.2.11)
      activesupport (= 3.2.11)
    activesupport (3.2.11)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    api_taster (0.6.0)
      bootstrap-sass (~> 2.1)
      jquery-rails
      rails (>= 3.1.0)
      redcarpet
      remotipart (~> 1.0)
      sass-rails
    arel (3.0.2)
    bcrypt-ruby (3.0.1)
    bcrypt-ruby (3.0.1-x86-mingw32)
    bootstrap-sass (2.2.2.0)
      sass (~> 3.2)
    bootswatch-rails (0.4.0)
      railties (>= 3.1)
    builder (3.0.4)
    carrierwave (0.8.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.5.0)
    commonjs (0.2.6)
    devise (2.2.1)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    hike (1.2.1)
    i18n (0.6.4)
    journey (1.0.4)
    jquery-rails (2.2.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.7.7)
    less (2.2.2)
      commonjs (~> 0.2.6)
    less-rails (2.2.6)
      actionpack (>= 3.1)
      less (~> 2.2.0)
    less-rails-bootstrap (2.2.1)
      less-rails (~> 2.2.0)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.21)
    multi_json (1.6.1)
    orm_adapter (0.4.0)
    pg (0.14.1)
    pg (0.14.1-x86-mingw32)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-protection (1.3.2)
      rack
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.11)
      actionmailer (= 3.2.11)
      actionpack (= 3.2.11)
      activerecord (= 3.2.11)
      activeresource (= 3.2.11)
      activesupport (= 3.2.11)
      bundler (~> 1.0)
      railties (= 3.2.11)
    railties (3.2.11)
      actionpack (= 3.2.11)
      activesupport (= 3.2.11)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.3)
    rdoc (3.12.2)
      json (~> 1.4)
    redcarpet (2.2.2)
    redis (3.0.2)
    redis-namespace (1.2.1)
      redis (~> 3.0.0)
    remotipart (1.0.2)
    resque (1.23.0)
      multi_json (~> 1.0)
      redis-namespace (~> 1.0)
      sinatra (>= 0.9.2)
      vegas (~> 0.1.2)
    resque-scheduler (2.0.0)
      redis (>= 2.0.1)
      resque (>= 1.20.0)
      rufus-scheduler
    rufus-scheduler (2.0.17)
      tzinfo (>= 0.3.23)
    sass (3.2.6)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sinatra (1.3.3)
      rack (~> 1.3, >= 1.3.6)
      rack-protection (~> 1.2)
      tilt (~> 1.3, >= 1.3.3)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.17.0)
    tilt (1.3.4)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    twitter-bootstrap-rails (2.2.4)
      actionpack (>= 3.1)
      execjs
      railties (>= 3.1)
    tzinfo (0.3.35)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    vegas (0.1.11)
      rack (>= 1.0.0)
    warden (1.2.1)
      rack (>= 1.0)

PLATFORMS
  ruby
  x86-mingw32

DEPENDENCIES
  api_taster
  bootswatch-rails
  carrierwave
  coffee-rails (~> 3.2.1)
  devise
  execjs
  jquery-rails
  less-rails-bootstrap
  pg
  rails (= 3.2.11)
  resque
  resque-scheduler
  sass-rails (~> 3.2.3)
  twitter-bootstrap-rails
  uglifier (>= 1.0.3)

我的宝石文件:-

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'sqlite3'

gem 'pg'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
 #  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'carrierwave'
                  <-----Line 27 
gem 'devise'

gem 'resque'
gem 'resque-scheduler', :require => 'resque_scheduler'

gem 'api_taster'

gem 'twitter-bootstrap-rails'

gem 'less-rails-bootstrap'

gem 'execjs'

# gem 'therubyracer'

gem 'bootswatch-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

你能帮我么。

4

3 回答 3

1

似乎 gem 'twitter-bootstrap-rails' 和 gem 'less-rails-bootstrap' 给出了错误。我在db:create.

C:\Sites\Library>rake db:create
[WARNING] Please install gem 'therubyracer' to use Less.
rake aborted!
cannot load such file -- v8
C:/Sites/Library/config/application.rb:7:in `<top (required)>'
C:/Sites/Library/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

所以我删除了它们。相反,我去了'bootstrap-sass' gem 在rails中实现引导程序,它似乎对我来说很好。不知道我是否正确

于 2013-03-07T04:02:38.540 回答
1

您可以从头开始重新开始一个项目,而不是做所有这些。请相应地更新您的gemfile

于 2013-03-07T06:58:14.103 回答
1

好的,既然您已经发现了我建议安装我知道 100% 有效的“bootstrap-sass”gem 的问题。

我碰巧回答了一个类似的问题,所以这里是链接: 如何使用该宝石以及为什么

于 2013-03-05T13:12:33.420 回答