gpt4 book ai didi

ruby-on-rails - 3.0.1升级后无法启动rails server

转载 作者:行者123 更新时间:2023-12-04 06:17:04 25 4
gpt4 key购买 nike

遵循 Railscast 上的说明但无法启动服务器。它指出以下错误:

$ rails s 
script/rails:6:in `require': no such file to load -- rails/commands (LoadError)`
from script/rails:6:in `<main>'

this related question上看到了答案但是我的 Gemfile 没有引用任何 rails 2.x 版本,在“捆绑安装”结果中,我在结果中得到了这个:“使用 rails (3.0.1)”

编辑:(添加 Gemfile.lock 详细信息)

GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.1)
actionpack (= 3.0.1)
mail (~> 2.2.5)
actionpack (3.0.1)
activemodel (= 3.0.1)
activesupport (= 3.0.1)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4.1)
rack (~> 1.2.1)
rack-mount (~> 0.6.12)
rack-test (~> 0.5.4)
tzinfo (~> 0.3.23)
activemodel (3.0.1)
activesupport (= 3.0.1)
builder (~> 2.1.2)
i18n (~> 0.4.1)
activerecord (3.0.1)
activemodel (= 3.0.1)
activesupport (= 3.0.1)
arel (~> 1.0.0)
tzinfo (~> 0.3.23)
activeresource (3.0.1)
activemodel (= 3.0.1)
activesupport (= 3.0.1)
activesupport (3.0.1)
arel (1.0.1)
activesupport (~> 3.0.0)
builder (2.1.2)
calendar_date_select (1.16.1)
erubis (2.6.6)
abstract (>= 1.0.0)
googlecharts (1.6.0)
i18n (0.4.2)
mail (2.2.9)
activesupport (>= 2.3.6)
i18n (~> 0.4.1)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mechanize (1.0.0)
nokogiri (>= 1.2.1)
mime-types (1.16)
nokogiri (1.4.3.1)
pg (0.9.0)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.6)
rack (>= 1.0)
rails (3.0.1)
actionmailer (= 3.0.1)
actionpack (= 3.0.1)
activerecord (= 3.0.1)
activeresource (= 3.0.1)
activesupport (= 3.0.1)
bundler (~> 1.0.0)
railties (= 3.0.1)
railties (3.0.1)
actionpack (= 3.0.1)
activesupport (= 3.0.1)
rake (>= 0.8.4)
thor (~> 0.14.0)
rake (0.8.7)
sparklines (0.5.2)
thor (0.14.4)
treetop (1.4.8)
polyglot (>= 0.3.1)
tzinfo (0.3.23)

PLATFORMS
ruby

DEPENDENCIES
calendar_date_select
googlecharts
mechanize
pg
rails (= 3.0.1)
sparklines

编辑:(添加 Boot.rb 详细信息)

require 'rubygems'

# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)

最佳答案

我遇到了同样的问题。

我修复了它只是删除了 Gemfile.lock 文件并从控制台运行

bundle install

如果你对Bundler也有问题,可以重新安装

gem install bundler # you may need sudo before. 

这使它对我有用。

关于ruby-on-rails - 3.0.1升级后无法启动rails server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4180754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com