在我升级了一些 gem 后,FullCalendar 停止工作。我需要将“google-api-client”添加到 Gemfile,并且 Bundle Install 过程给了我以下消息:
itsjustme@rubberroom:~/Projects/FunnyFarm$ bundle
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Bundler could not find compatible versions for gem "faraday":
In snapshot (Gemfile.lock):
faraday (0.8.0)
In Gemfile:
google-api-client (>= 0.5.0) ruby depends on
faraday (~> 0.8.1) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
按照说明,我发布了捆绑更新。结果是这样的:
itsjustme@rubberroom:~/Projects/FunnyFarm$ bundle update
Fetching gem metadata from https://rubygems.org/.....
Error Bundler::HTTPError during request to dependency API
Fetching full source index from https://rubygems.org/
Using rake (10.0.2)
Using i18n (0.6.1)
Using multi_json (1.3.7)
Using activesupport (3.2.3)
Using builder (3.0.4)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.3)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Installing addressable (2.3.2)
Installing extlib (0.9.15)
Installing autoparse (0.3.2)
Using bcrypt-ruby (3.0.1)
Using bundler (1.2.2)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.3)
Using coffee-rails (3.2.2)
Using multipart-post (1.1.5)
Using faraday (0.8.4)
Using jwt (0.1.5)
Installing launchy (2.1.2)
Installing signet (0.4.3)
Installing uuidtools (2.1.3)
Installing google-api-client (0.5.0)
Using haml (3.1.7)
Using httpauth (0.2.0)
Using jquery-rails (2.1.3)
Using libv8 (3.3.10.4)
Using mobilepronto (0.3.2)
Using mysql2 (0.3.11)
Using oauth (0.4.7)
Using oauth2 (0.6.1)
Using rails (3.2.3)
Using sass (3.2.3)
Using sass-rails (3.2.5)
Using sorcery (0.7.13)
Using sqlite3 (1.3.6)
Using therubyracer (0.10.2)
Using uglifier (1.3.0)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem
is installed.
CSS 和 jQuery 文件都没有被修改,作为 RoR 的新手,我不知道从哪里开始寻找解决方案。
截图
这是更新前的截图:http: //pic.twitter.com/85gUGSg3
这个,更新后:http: //pic.twitter.com/rYvIhsbe
文件
这种观点太简单了,无法有所作为。但是,无论如何(show.html.haml):
%h4 Agenda dos Médicos
#calendar
同样,控制器几乎是空的。它只是指向视图。
class WorkSchedsController < ApplicationController
before_filter :require_login
def show
end
end
这一切都归功于 fullcalendar.js,配置如下:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventSources: [
// Dr. John Doe
{
url: 'https://www.google.com/calendar/feeds/userthis%40gmail.com/private-blah/basic',
color: 'dodgerblue'
},
// Dr. Jane Doe
{
url: 'https://www.google.com/calendar/feeds/userthat%40gmail.com/private-blah/basic',
color: 'brown'
},
// Code abbreviated
{
...
}
]
});
});
为了完整起见,这是 Gemfile,在添加“fullcalendar-rails”之前(如 Durrant 先生所建议):
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'sorcery'
gem 'mobilepronto'
gem 'execjs'
gem 'therubyracer'
gem 'mysql2'
gem 'haml'
gem 'sass'
# 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
gem 'jquery-rails'
似乎设置日历的表已被压平。任何人都可以帮忙吗?给点指点什么的?