I have an existing ruby on rails project on my desktop (Moovit). now i want to run this existing project on my linux. but i can't seem to run it. i dont know if im doing it right. i transferred it to my root folder then i run this code rails new Moovit -s
i dont know if this is correct? It's not working and when i checked on my browser. it says hello world . the Moovit project is a website. I've created a backup in case of trouble. I also go to Moovit folder then rails s
but it's not working. I also run bundle install
but still not working. How should I do it?
我的桌面上有一个现有的ruby on rails项目(Moovit)。现在我想在我的linux上运行这个现有的项目。但我似乎不能运行它。我不知道我做得对不对。我把它转移到我的根文件夹然后运行这个代码rails新的Moovit -s我不知道这是否正确?它不工作,当我在浏览器上检查时。它说你好世界。Moovit项目是一个网站。我在遇到麻烦时创建了备份。我也去了Moovit文件夹然后rails s,但是它不工作。我也运行包安装,但仍然不能工作。我该怎么做呢?
info:
信息:
Rails 3.2.1
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
bundle show activesupport
包显示activesupport这样
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6
when i run bundle install
当我运行bundle install时
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
cd Moovit
rails -s
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick
=> Rails 3.0.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/root/Moovit/config/initializers/wrap_parameters.rb:8:in `block in <top (required)>': undefined method `wrap_parameters' for ActionController::Base:Class (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
from /root/Moovit/config/initializers/wrap_parameters.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:235:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:235:in `block in load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:235:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/engine.rb:201:in `block (2 levels) in <class:Engine>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/engine.rb:200:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/engine.rb:200:in `block in <class:Engine>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/initializable.rb:25:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/initializable.rb:50:in `block in run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/initializable.rb:49:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/application.rb:134:in `initialize!'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/application.rb:77:in `method_missing'
from /root/Moovit/config/environment.rb:5:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `require'
from /root/Moovit/config.ru:3:in `block in <main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
from /root/Moovit/config.ru:1:in `new'
from /root/Moovit/config.ru:1:in `<main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/builder.rb:35:in `eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/builder.rb:35:in `parse_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/server.rb:162:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/server.rb:248:in `wrapped_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/server.rb:213:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/commands/server.rb:65:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/commands.rb:30:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/commands.rb:27:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.6/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
also how should i run it on my specific ip address? it seems that on my /var/www/html/ there's an index.html which says hello world. and my ruby on rails project is on root folder. I'm really lost. I thought when just running those commands will make it available to my server?
我应该如何在我的特定ip地址上运行它?似乎在我的/var/www/html/上有一个索引。html,表示hello world。我的ruby on rails项目在根文件夹上。我真的失去了。我以为只要运行这些命令就能使我的服务器可用?
2 个解决方案
#1
3
Go to /config/initializers/wrap_parameters.rb
, comment out the previous codes and try this code
去/ config /初始化/ wrap_parameters。rb,注释掉之前的代码并尝试此代码
ActiveSupport.on_load(:action_controller) do
include ActionController::ParamsWrapper
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
#2
3
Follow Bellow Instruction:
遵循风箱指令:
- cd project_name
- cd project_name
- bundle install
- 包安装
- rails s
- rails的年代
Also which version of rails do you use for project.
您还可以在项目中使用哪个版本的rails。
Please add config/initializers/wrap_parameters.rb and the restart your server.
请添加配置/初始化/ wrap_parameters。rb和重新启动服务器。
ActiveSupport.on_load(:action_controller) do
if self == ActionController::Base
wrap_parameters :format => [:json]
end
end
#1
3
Go to /config/initializers/wrap_parameters.rb
, comment out the previous codes and try this code
去/ config /初始化/ wrap_parameters。rb,注释掉之前的代码并尝试此代码
ActiveSupport.on_load(:action_controller) do
include ActionController::ParamsWrapper
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
#2
3
Follow Bellow Instruction:
遵循风箱指令:
- cd project_name
- cd project_name
- bundle install
- 包安装
- rails s
- rails的年代
Also which version of rails do you use for project.
您还可以在项目中使用哪个版本的rails。
Please add config/initializers/wrap_parameters.rb and the restart your server.
请添加配置/初始化/ wrap_parameters。rb和重新启动服务器。
ActiveSupport.on_load(:action_controller) do
if self == ActionController::Base
wrap_parameters :format => [:json]
end
end