gpt4 book ai didi

ruby - 在Linux机器上通过 "refinerycms"创建的Web浏览器访问应用程序?

转载 作者:太空宇宙 更新时间:2023-11-04 05:04:38 26 4
gpt4 key购买 nike

我在我的 Linux 终端中创建了一个应用程序“my_new_app”,如下所示:

u107@mint107 ~ $ refinerycms /home/u107/my_new_app
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
apply /var/lib/gems/1.9.1/gems/refinerycms-2.1.0/templates/refinery/installer.rb
/var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /var/lib/gems/1.9.1/gems/refinerycms-2.1.0/templates/refinery/installer.rb:6:in `apply'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/actions.rb:221:in `instance_eval'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/actions.rb:221:in `apply'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/generators/app_base.rb:109:in `apply_rails_template'
from (eval):1:in `apply_rails_template'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /var/lib/gems/1.9.1/gems/refinerycms-2.1.0/bin/refinerycms:43:in `<top (required)>'
from /usr/local/bin/refinerycms:23:in `load'
from /usr/local/bin/refinerycms:23:in `<main>'
u107@mint107 ~ $ ^C
u107@mint107 ~ $ cd /home/u107/my_new_app/
u107@mint107 ~/my_new_app $ rails server
/var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/u107/my_new_app/config/application.rb:13:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
u107@mint107 ~/my_new_app $

目录结构是这样的:

./log
./script
./config
./config/locales
./config/initializers
./config/environments
./lib
./lib/tasks
./lib/assets
./public
./vendor
./vendor/plugins
./vendor/assets
./vendor/assets/stylesheets
./vendor/assets/javascripts
./db
./tmp
./tmp/cache
./tmp/cache/assets
./app
./app/views
./app/views/layouts
./app/helpers
./app/models
./app/assets
./app/assets/images
./app/assets/stylesheets
./app/assets/javascripts
./app/controllers
./app/mailers
./doc

所以我遇到了一个问题,我不知道如何在网络浏览器中访问它请告诉我如何在网络浏览器中看到这个应用程序。请快速回答。提前致谢

Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
u107@mint107 ~/my_new_app $ rails server
/var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /var/lib/gems/1.9.1/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /var/lib/gems/1.9.1/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/u107/my_new_app/config/application.rb:13:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /var/lib/gems/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

最佳答案

根据文档,进入您的项目(具有您列出的文件夹的项目),然后运行:

rails server 或简称 rails ,在您确保已捆绑之后。

您可以查看文档 here 。然后,您可以在浏览器中的 localhost:3000 中看到它,就像任何其他 ruby​​ Web 应用程序一样(只要您不在 rails server 命令上使用 -b-p。如果这样做,则必须相应地更改此 url)。

编辑:

根据您的更新,您需要一个 javascript 运行时。您可以使用 therubyracer 来实现此目的,因为大多数情况下它默认包含在 Rails 项目的 Gemfile 中。您应该检查 Gemfile 中是否有 gem "therubyracer",如果它被注释掉,请取消注释并重新捆绑,然后再次尝试 rails

关于ruby - 在Linux机器上通过 "refinerycms"创建的Web浏览器访问应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20138393/

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