gpt4 book ai didi

ruby-on-rails - 更好的错误 Gem 无法在本地浏览器中运行,没有可见的错误

转载 作者:行者123 更新时间:2023-12-03 14:32:37 25 4
gpt4 key购买 nike

我将 Better Errors gem 添加到我的 gemfile 中,如下面的 gemfile 所示,然后运行 ​​bundle 并看到 Using better_errors 1.1.0并多次重新启动我的服务器。我观看了有关如何安装它的 railscast 剧集。过去我在安装任何其他 gem 时从来没有遇到过问题(我是编程新手)。我阅读了文档,并且已经对此进行了检查:

Note: If you discover that Better Errors isn't working - particularly after upgrading from version 0.5.0 or less - be sure to set config.consider_all_requests_local = true in config/environments/development.rb.

任何关于如何让这个 gem 工作的想法将不胜感激!这是我的 gem 文件:
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.5'

group :development, :test do

gem 'rspec-rails'
gem 'capybara'
end


# Use sqlite3 as the database for Active Record
group :production do
gem 'pg'
gem 'rails_12factor'
end

group :development do
gem 'sqlite3'
gem 'better_errors'
end

gem 'bootstrap-sass', '~> 3.1.1'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

最佳答案

使用 Vagrant,将其添加到您应用的 config/environments/development.rb (configure block 内的任何位置):

BetterErrors::Middleware.allow_ip! "0.0.0.0/0"

然后重启你的服务器。

(这只是 Sasha 解决方案的一个细微变化。)

DO NOT add this to your production environment!

关于ruby-on-rails - 更好的错误 Gem 无法在本地浏览器中运行,没有可见的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26152964/

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