我正在尝试使用最基本的 app.rb 运行 Sinatra 应用程序:
require 'sinatra/activerecord/rake'
require 'bundler/setup'
Bundler.require(:default)
require_relative './config'
require_relative './models/star'
require_relative './models/planet'
require_relative './models/moon'
require_relative './models/astronaut'
get '/' do
erb :index
end
使用 Bundle 并创建 Gemfile.lock 后,我不断收到此错误:
You have already activated activesupport 4.0.2, but your Gemfile requires activesupport 3.2.16. Using bundle exec may solve this. (Gem::LoadError)
我的 Rakefile 是:
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-reloader'
gem 'sinatra-activerecord'
gem 'activerecord', '~> 3.2.13'
gem 'rake'
gem 'pg'
gem 'pry'
我会很感激任何建议。