1

搜索了高和低...发现了类似的问题,但没有任何修复有帮助...有没有人知道接下来要尝试什么?

我正在关注Railstutorial.org 5.1.2并在安装 bootstrap-sass gem 后,重新启动 apache 后得到以下信息:

Could not find bootstrap-sass-2.3.2.2 in any of the sources (Bundler::GemNotFound)
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
  /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `require'
  /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
  /home/bart/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:142:in `require'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:96:in `preload_app'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:28:in `<main>'

已安装引导程序...(也尝试了 2.3.2.0 版)

bart:/var/www/sample_app$ bundle | grep bootstrap
Using bootstrap-sass (2.3.2.2) 

bart:/var/www/sample_app$ bundle show bootstrap
/home/bart/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/bootstrap-sass-2.3.2.2

将 gem bootstrap-sass 放入 Gemfile 中的 :asset 组已经解决了类似的问题 - 这没有帮助。(例如,几乎完全相同的东西

group :assets do
  gem 'sass-rails', '4.0.0'
  gem 'uglifier', '2.1.1'
  gem 'coffee-rails', '4.0.0'
  gem 'bootstrap-sass', '2.3.2.0'
end

实际上,我刚刚在 Gemfile 中添加了 bcrypt-ruby-3.1.2 gem,这给出了同样的问题......

我跳过了第 3 章(全部 3.6)的结尾,那里有更多关于测试的内容,所以也许我在某个地方错过了一步,但那里的一切似乎都是可选的。

其他人提到做一个

rake gem

或 rake gemspec 但我得到了类似的东西:

bart:/var/www/sample_app$ bundle exec rake gemspec --trace
rake aborted!
Don't know how to build task 'gemspec'

并且还没有弄清楚这到底意味着什么。

更多细节:

bart:/var/www/sample_app$ rvm info
ruby-2.0.0-p247@railstutorial_rails_4_0:

  system:
    uname:       "Linux 452422 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "ubuntu/12.04/x86_64"
    bash:        "/bin/bash => GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.22.15 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "1 day 6 hours 36 minutes 3 seconds ago"
    path:         "/home/bart/.rvm"

  ruby:
    interpreter:  "ruby"
    version:      "2.0.0p247"
    date:         "2013-06-27"
    platform:     "x86_64-linux"
    patchlevel:   "2013-06-27 revision 41674"
    full_version: "ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]"

  homes:
    gem:          "/home/bart/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0"
    ruby:         "/home/bart/.rvm/rubies/ruby-2.0.0-p247"

  binaries:
    ruby:         "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/ruby"
    irb:          "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/irb"
    gem:          "/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin/gem"
    rake:         "/home/bart/.rvm/gems/ruby-2.0.0-p247@global/bin/rake"

  environment:
    PATH:         "/home/bart/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/bin:/home/bart/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/bart/.rvm/rubies/ruby-2.0.0-p247/bin:/home/bart/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/home/bart/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0"
    GEM_PATH:     "/home/bart/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0:/home/bart/.rvm/gems/ruby-2.0.0-p247@global"
    MY_RUBY_HOME: "/home/bart/.rvm/rubies/ruby-2.0.0-p247"
    IRBRC:        "/home/bart/.rvm/rubies/ruby-2.0.0-p247/.irbrc"
    RUBYOPT:      ""
    gemset:       "railstutorial_rails_4_0"
4

2 回答 2

2

解决了。

非常感谢所有建议——尝试它们帮助我继续推动不同的事业。

rails s(在应用程序内部)产生良好的结果时,线索就出现了,但点击 apache 却没有。找到了我错过的Apache/Passenger 设置文档(RoR 的新手,所以实际上“不知道”)在虚拟主机配置中设置了 PassengerRuby。

根据教程,我创建了 gemset “railstutorial_rails_4_0”/home/bart/.rvm/wrappers/ruby-2.0.0-p247@railstutorial_rails_4_0

在 /etc/apache2/mods-available/passenger.conf

PassengerRoot /home/bart/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19
PassengerDefaultRuby /home/bart/.rvm/wrappers/ruby-2.0.0-p247/ruby

bundle install在将东西放入教程 gemset之前,这很棒。

我在虚拟主机定义中错过了这个:

PassengerRuby /home/bart/.rvm/wrappers/ruby-2.0.0-p247@railstutorial_rails_4_0/ruby

重启阿帕奇。

现在它完美地工作了!

于 2013-10-05T15:29:06.533 回答
0

您已gem 'bootstrap-sass', '2.3.2.0'在 Gemfile 中指定,但在您的机器上加载了 2.3.2.2。尝试卸载 gem 并重新运行 bundle 命令。

bundle exec gem uninstall GEM_NAME
bundle install

不久前我也浏览了本教程。查看我的代码,我从未指定 bootstrap-sass 的版本。您可能也想尝试一下。

于 2013-10-04T17:34:57.093 回答