1
我期待運行名爲「sinatra_active_record_start」一西納特拉的應用程序遷移,但不能讓我的設置正確。試圖在西納特拉運行遷移,但不能加載西納特拉應用
當我運行bundle exec rake -T
我得到:
LoadError: cannot load such file -- sinatra_active_record_start
/Users/jasonnappy/ga_wdi/exisiting_resources/wdi_london/resources/materials/local/06-server-applications/ruby/sinatra/active-record/sinatra_active_record_start/Rakefile:1:in `require'
同樣的當我運行爲:
bundle exec rake db:create_migration first_migration
我的Gemfile是:
source "https://rubygems.org"
gem "sinatra"
gem "activerecord"
gem "sinatra-activerecord"
gem "rake"
gem "thin"
我的Rake文件是:
require "sinatra_active_record_start"
require "sinatra/activerecord/rake"
namespace :db do
desc "Migrate the database"
task(:migrate => :environment) do
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Migration.verbose = true
ActiveRecord::Migrator.migrate("db/migrate")
end
end
的app.rb
頂部是:
require "bundler/setup"
require "sinatra"
require "activerecord"
require "sinatra/activerecord"
我知道有一些裁員,但在這一點上,我只是想插上,使一些工作,我在互聯網上找到。