0

我按顺序执行了以下步骤,但在运行 webrick 时遇到问题

我有一个centos 6安装

第 1 步:http: //blog.jeffcosta.com/2011/07/22/install-ruby-version-manager-rvm-on-centos-6/

第二步:server-world.info/en/note?os=CentOS_6&p=mysql

第三步:sudo install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config gem install -y mysql -- --with-mysql-config=/usr/bin/mysql_config

它安装了所有的宝石,没有任何问题。

但是当我从使用rails new simple_cms -d mysql创建的应用程序中加载 webrick

结果: 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
创建 app/controllers/application_controller.rb
创建 app/helpers/application_helper.rb
创建 app/mailers
创建 app/models
创建 app/views/layouts/application.html.erb
创建 app/mailers/.gitkeep
创建 app/models/.gitkeep
创建配置
创建 config/routes.rb
创建 config/application.rb
创建 config/environment.rb
创建 config/environments
创建 config/environments/development.rb
创建 config/environments/production.rb
创建 config/environments/test.rb
创建 config/initializers
创建配置/初始化程序/backtrace_silencers.rb 创建配置
/初始化程序/inflections.rb 创建配置
/初始化程序/mime_types.rb 创建配置
/初始化程序/secret_token.rb 创建配置
/初始化程序/session_store.rb 创建
配置/初始化程序/wrap_parameters.rb
创建配置/语言环境
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 test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/样式表
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
从 [https://rubygems.org/] 获取 gem 元数据。
无法加载 OpenSSL。您必须使用 OpenSSL 支持重新编译 Ruby,或将 Gemfile 中的源代码从“https”更改为“http”。rvm.io/packages/openssl 提供了使用 RVM 使用 OpenSSL 进行编译的说明。

运行 rails 服务器时出现以下错误:

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/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) <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs.rb:5:in'
来自 /usr/local/rvm/gems/ruby-1.9 .3-p194/gems/execjs-1.4.0/lib/execjs.rb:4:in<top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in要求
来自 /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2。 0/lib/coffee_script.rb:1:in<top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in需要'
来自 /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1 :in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:inrequire'
来自 /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:inrequire'
来自 /usr/local /rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in block (2 levels) in require' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:ineach'
来自 /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in block in require' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:ineach'
来自 /usr/local/rvm/gems /ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:inrequire' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:119:in要求
来自 /root/railsdev/simple_cms/config/application.rb:7:in<top (required)>' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:53:in要求'
来自 /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:53:in block in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:intap'
来自 /usr/local/rvm/gems/ ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:in <top (required)>' <br> from script/rails:6:inrequire'
from script/rails:6:in `'

我该如何解决?
rvm info 给出以下结果

红宝石-1.9.3-p194:

系统: uname: "Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Tue Dec 6 16:15:40 GMT 2011 i686 i686 i386 GNU/Linux" bash: "/bin/bash => GNU bash,版本 4.1.2(1)-release (i386-redhat-linux-gnu)" zsh: " => 未安装"

rvm: 版本: "rvm 1.14.7 (stable) by Wayne E. Seguin, Michal Papis [https://rvm.io/]" 更新: "1 小时 22 分 29 秒前"

ruby:解释器:“ruby”版本:“1.9.3p194”日期:“2012-04-20”平台:“i686-linux”补丁级别:“2012-04-20 修订版 35410”full_version:“ruby 1.9.3p194(2012 -04-20 修订版 35410) [i686-linux]"

家园:宝石:“/usr/local/rvm/gems/ruby-1.9.3-p194” 红宝石:“/usr/local/rvm/rubies/ruby-1.9.3-p194”

二进制文件: 红宝石:“/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby” irb:“/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb”宝石:“/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem” 耙子:“/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake”

环境:路径:“/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/ rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin: /bin:/root/bin" GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.3-p194" GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.3-p194:/usr /local/rvm/gems/ruby-1.9.3-p194@global" MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194" IRBRC: "/usr/local/rvm/rubies/ruby -1.9.3-p194/.irbrc" RUBYOPT: "" gemset: ""

4

2 回答 2

0

安装 NodeJS 并将 gem 添加到 Gemfile 中。这应该可以解决运行时问题。

于 2012-07-25T23:44:05.303 回答
0

Since Rails 3.1, a JavaScript runtime has been needed for development on Linux Ubuntu. It is not needed for Mac OS X or Windows.

For development on Linux Ubuntu, it’s best to install the Node.js server-side JavaScript environment:

sudo apt-get install nodejs

and set it in your $PATH.

If you don’t install Node.js, you’ll need to add this to the Gemfile for each Rails application you build:

gem 'therubyracer', '>= 0.9.9'

source

于 2012-09-04T19:04:19.387 回答