Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法在本地生产环境中启动rails-rails 5_Ruby On Rails_Ruby_Ruby On Rails 5 - Fatal编程技术网

Ruby on rails 无法在本地生产环境中启动rails-rails 5

Ruby on rails 无法在本地生产环境中启动rails-rails 5,ruby-on-rails,ruby,ruby-on-rails-5,Ruby On Rails,Ruby,Ruby On Rails 5,这是我第一次在生产环境中启动rails应用程序。我首先运行了railsserver-e产品,然后必须获得密钥。之后,我运行了这一行bundle exec rake assets:precompile db:migrate RAILS\u ENV=production。当我运行这一行时,我又运行了一次rails server-e production,在我的终端中出现了以下错误(参见最后4行)以及浏览器中的404错误页面: krav@krav-Q534UXK:~/Desktop/cnd$ rail

这是我第一次在生产环境中启动rails应用程序。我首先运行了
railsserver-e产品
,然后必须获得密钥。之后,我运行了这一行
bundle exec rake assets:precompile db:migrate RAILS\u ENV=production
。当我运行这一行时,我又运行了一次
rails server-e production
,在我的终端中出现了以下错误(参见最后4行)以及浏览器中的404错误页面:

krav@krav-Q534UXK:~/Desktop/cnd$ rails server -e production
=> Booting Puma
=> Rails 5.1.3 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.10.0 (ruby 2.3.3-p222), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
/home/krav/Desktop/cnd/app/views/creatives/index.html.erb:20: warning: key :data is duplicated and overwritten on line 20
/home/krav/Desktop/cnd/app/views/creatives/index.html.erb:20: warning: key :data is duplicated and overwritten on line 20
/home/krav/Desktop/cnd/app/views/creatives/index.html.erb:107: warning: key :data is duplicated and overwritten on line 107
/home/krav/Desktop/cnd/app/views/creatives/index.html.erb:107: warning: key :data is duplicated and overwritten on line 107
当我转到此处给出错误的行时,它们分别是:

第20行

<%= image_tag "AdobeStock_95578405.jpeg" ,alt: "slidebg1", :data => {bgposition: "center bottom"} , :data => {bgrepeat: "no-repeat"} ,:data => {bgfit: "cover"} , :class => "rev-slidebg" %>
{bgposition:“中间-底部”},:data=>{bgpeat:“无重复”},:data=>{bgfit:“cover”},:class=>“rev slidebg”%>
第107行

<%= image_tag "AdobeStock_108067927.jpeg" ,alt: "slidebg1", :data => {bgposition: "center bottom"} , :data => {bgrepeat: "no-repeat"} ,:data => {bgfit: "cover"} , :class => "rev-slidebg" %>
{bgposition:“中间-底部”},:data=>{bgpeat:“无重复”},:data=>{bgfit:“cover”},:class=>“rev slidebg”%>
在开发中,这很好。我不明白为什么这些行给了我一个错误,不允许web应用程序启动它们看起来是正确的,让我在开发模式中获得了所需的外观


行中有重复的数据键,并且只能有一个:

i、 e.这:
{bgposition:“中间-底部”},:data=>{bgprepeat:“无重复”},:data=>{bgfit:“cover”},:class=>“rev slidebg”%>

应该是这样:
{bgposition:“中间底部”,bgpeat:“无重复”,bgfit:“封面”},:class=>“rev slidebg”%>