當我開始運行我的rails服務器時,當我到localhost:3000時,發現這個文件未找到錯誤。我收到的消息是couldn't find file 'jquery.effects.core'
。我已經盡了許多努力,從我的回購庫中重新安裝應用程序的新克隆,重新安裝Rails和Ruby,但都導致同樣的錯誤。有任何想法嗎?Sprockets :: FileNotFound - 找不到文件'query.effects.core'
我碰到下面的輸出,當我運行軌道服務器:
sudo rails s
=> Booting Thin
=> Rails 3.2.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
This poses a security threat. It is strongly recommended that you
provide a secret to prevent exploits that may be possible from crafted
cookies. This will not be supported in future versions of Rack, and
future versions will even invalidate your existing user cookies.
Called from: /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
,這裏是我的Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'rails_admin'
gem 'devise'
gem 'cancan'
gem 'simple_form'
gem 'kaminari'
gem 'bootstrap-kaminari-views'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'acts_as_commentable_with_threading'
# 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'
gem 'uglifier', '>= 1.0.3'
end
group :production do
gem 'thin'
end
gem 'libv8', '~> 3.11.8'
gem "therubyracer", '>= 0.11.0beta8', :require => 'v8'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem "less-rails"
gem 'paperclip'
gem 'aws-sdk'
gem 'jquery-rails'
EDIT(解決):這是我的application.js文件。當我取消註釋= require jquery
行時,一切似乎都奏效。我不知道該如何解釋這個問題,因爲還有其他人使用相同的源代碼集,即使該行被註釋掉也不會遇到此問題。
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery <----------------
//= require jquery_ujs
//= require twitter/bootstrap
//= require_tree .
你可以發佈你的'application.js'嗎? –
我通過取消註釋=需要jquery_ujs來解決問題,但我仍然不確定爲什麼會發生這種情況,因爲其他人正在使用相同的源代碼(將此行註釋掉),並且沒有遇到此問題。 – vette982
清單文件的語法(如'application.js')很奇怪。什麼意思你沒有註釋,因爲常見的插入就像其他語言中的註釋一樣。無論如何,很高興聽到問題解決。 –