如果我尝试使用任何rake命令,我会在标题中收到错误消息。
root@project:/home/user/project# rake --trace
rake aborted!
no such file to load -- jeweler
/home/user/project/Rakefile:18:in `require'
/home/user/project/Rakefile:18
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:94:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:165:in 'standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:77:in `run'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/var/lib/gems/1.8/gems/rake-10.1.1/bin/rake:33
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
root@project:/home/user/project#
然而,我安装了珠宝宝石并且一切正常
root@project:/home/user/project# gem install jeweler
Successfully installed jeweler-1.8.8
1 gem installed
Installing ri documentation for jeweler-1.8.8...
Installing RDoc documentation for jeweler-1.8.8...
root@project:/home/user/project# which jeweler
/usr/local/bin/jeweler
root@project:/home/user/project# gem list
*** LOCAL GEMS ***
actionmailer (3.2.9)
actionpack (3.2.9)
activemodel (3.2.9)
activerecord (3.2.9)
activeresource (3.2.9)
activesupport (3.2.9)
addressable (2.3.5)
akami (1.2.0)
arel (3.0.3, 3.0.2)
builder (3.0.4)
bundler (1.3.5, 1.2.2, 1.2.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
crack (0.3.1)
erubis (2.7.0)
execjs (1.4.0)
faraday (0.8.8)
git (1.2.5)
github_api (0.10.1)
gyoku (1.1.0, 0.4.6)
hashie (2.0.5)
highline (1.6.20)
hike (1.2.3, 1.2.1)
httpauth (0.2.0)
httpi (1.1.1)
i18n (0.6.9, 0.6.1)
jeweler (1.8.8, 1.8.4)
journey (1.0.4)
jquery-rails (2.1.3)
json (1.7.5)
jwt (0.1.8)
libv8 (3.3.10.4 x86-linux)
mail (2.4.4)
mime-types (1.25.1, 1.19)
mini_portile (0.5.2)
multi_json (1.8.2, 1.3.7)
multi_xml (0.5.5)
multipart-post (1.2.0)
nokogiri (1.5.10, 1.5.5)
nori (1.1.3)
oauth2 (0.9.2)
polyglot (0.3.3)
rack (1.4.5, 1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.9)
railties (3.2.9)
rake (10.1.1, 10.0.2, 10.0.1)
rdoc (3.12)
sass (3.2.3)
sass-rails (3.2.5)
savon (1.2.0, 0.7.9)
sprockets (2.2.2, 2.2.1)
sqlite3 (1.3.6)
therubyracer (0.10.2)
thor (0.16.0)
tilt (1.4.1, 1.3.3)
treetop (1.4.15, 1.4.12)
tzinfo (0.3.38, 0.3.35)
uglifier (1.3.0)
wasabi (2.5.1)
任何人都会看到我在这里做错了什么?
更新1
我忘了提到rails服务器运行正常以及Web应用程序,但是当我尝试向我的数据库添加新条目时,我为它们创建了迁移并且工作正常,但是当我输入“rake db”时:迁移“这个问题出现了。
这是我的Rakefile
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake/dsl_definition'
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "pvwatts"
gem.homepage = "http://github.com/bstrech/pvwatts"
gem.license = "MIT"
gem.summary = %Q{Wrapper around the http://www.nrel.gov/rredc/pvwatts/ web service API. Forked from Matt Aimonetti.}
gem.description = %Q{Calculates the Performance of a Grid-Connected PV System.}
gem.email = "bstrech@gmail.com"
gem.authors = ["Brenda Strech"]
# Include your dependencies below. Runtime dependencies are required when using your gem,
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
# gem.add_runtime_dependency 'savon', '~> 0.7.6'
gem.add_runtime_dependency 'savon', '~> 1.2.0'
# gem.add_development_dependency 'rspec', '> 1.2.3'
end
Jeweler::RubygemsDotOrgTasks.new
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end
task :default => :spec
require 'yard'
YARD::Rake::YardocTask.new
require File.expand_path('../config/application', __FILE__)
MyApp::Application.load_tasks