我是Rails和编程的新手。我按照YouTube上的教程构建了一个应用程序。我完成了整个工作,然后开始摆弄Ruby和Rails版本。也许是一个错误....无论如何,我再也无法让Rails S命令工作了。粘贴在下面是我得到的错误。我欢迎你提出任何建议。
tom @ linux:〜/ apps / BookReview $ rails s
=>引导美洲狮
=> Rails 5.2.0应用程序从开发开始
=>运行rails server -h
以获取更多启动选项
退出
/home/tom/apps/BookReview/config/environments/development.rb:3:in block in <top (required)>': uninitialized constant Paperclip (NameError)
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/railtie.rb:216:in
instance_eval&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/railtie.rb:216:in configure'
from /home/tom/apps/BookReview/config/environments/development.rb:1:in
& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/engine.rb:602:in block (2 levels) in <class:Engine>'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/engine.rb:601:in
每个& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/engine.rb:601:in block in <class:Engine>'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in
instance_exec& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in run'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in
块在run_initializers&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in
块(2级)in each_strongly_connected_component&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in
each_strongly_connected_component_from&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:421:in block in each_strongly_connected_component_from'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in
每个&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in tsort_each_child'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in
来电& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:415:in each_strongly_connected_component_from'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in
块中的each_strongly_connected_component&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in each'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in
来电&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in
tsort_each&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in tsort_each'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in
run_initializers&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in initialize!'
from /home/tom/apps/BookReview/config/environment.rb:5:in
& #39;
来自config.ru:3:in require_relative'
from config.ru:3:in
阻止&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in instance_eval'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in
初始化& #39;
来自config.ru:in new'
from config.ru:in
&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in eval'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in
new_from_string& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in parse_file'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/server.rb:319:in
build_app_and_options_from_config& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/server.rb:219:in app'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:27:in
app& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/server.rb:354:in wrapped_app'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:89:in
log_to_stdout& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:51:in {{ 1}}阻止执行&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in {{ 1}}执行&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in start'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:147:in
invoke_command& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in tap'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in
表演&#39 ;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/command.rb:46:in run'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
& #39;
来自/ home / tom / apps / BookReview / bin / rails:9:dispatch'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in
&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in {{1} }呼叫&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in {{1} }运行&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in invoke'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in
loading&#39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in require'
from /home/tom/apps/BookReview/bin/rails:9:in
要求& #39;
来自/home/tom/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in load'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in
&#39;
来自bin / rails:3:call'
from /home/tom/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in
&#39;
答案 0 :(得分:0)
在您的Gemfile中包含paperclip gem,如果它尚未添加。
gem "paperclip", git: "git://github.com/thoughtbot/paperclip.git"
之后运行bundle install