JRuby加载错误

时间:2017-08-24 08:13:25

标签: ruby-on-rails jruby jrubyonrails

我试图在我的系统上启动Ruby on Rails项目。我已经安装了来自cmd screenshot链接的jruby和来自railsinstaller[dot]org的Rails 现在,在进行捆绑安装时,它给了我:尝试bundle install jruby-openssl或尝试bundle update作为jruby-openssl version locked at 0.0.9 in your lock file
执行bundle update后,它会一直显示jruby-openssl相关警告 而且,当我启动rails服务器时,它会受到打击:

POSIX standard for echo

其他人是否遇到过类似的问题? 我做错了什么?
我还包括gem filelock file吗? 编辑:宝石文件

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.7'
# Use jdbcmysql as the database for Active Record
gem 'activerecord-jdbcmysql-adapter'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See js#readme for more supported runtimes
gem 'therubyrhino'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: 
gem 'turbolinks'
# Build JSON APIs with ease. 
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'activeresource', '~> 4.1'

gem 'jruby-openssl'

gem 'faker', :groups => [:development, :test]

gem 'apipie-rails'

gem 'rest-client'

gem 'rest-client-components'

gem 'bootstrap-sass'

gem 'jquery-ui-rails', '~> 5.0', '>= 5.0.5'
gem 'font-awesome-sass', '~> 4.7.0'

gem 'activerecord-session_store'

gem 'active_model_serializers', '~> 0.10.2'

gem 'simple_token_authentication', '~> 1.0' 

gem 'legacy_model_generator', '~> 0.2', :group => :development

gem 'devise', '~> 4.2'

gem 'cancancan', '~> 1.10'

gem "espinita"

gem 'kaminari'

gem 'warbler', '~>2.0', :group => :development

gem 'rspec-rails', :groups => [:development, :test]

gem 'composite_primary_keys'

gem 'rack-cors'
gem 'graphql'
gem 'graphiql-rails'

group :test do
    gem 'database_cleaner'
    gem 'cucumber-rails', :require => false
end

gem 'inifile', '~> 3.0'

gem 'angular_rails_csrf'

gem 'health_check' 

1 个答案:

答案 0 :(得分:0)

railsinstaller.org 下载包含一个版本的MRI Ruby运行时。因此,当您运行rails c时,您实际上是在MRI Ruby中运行Rails控制台而不是JRuby;因此 jruby-openssl gem的错误。

您可以尝试以下两种方法之一:

  • jruby -S rails c身份运行 rails 命令。这将确保它在Ruby中运行而不是MRI。
  • 更改命令路径,以便JRuby版本的ruby命令具有比MRI更高的优先级。 (对不起,我无法帮助你,因为我不会说Windows。)

在Linux和MacOS上,您也可以使用Ruby管理器,例如rvmrbenv。我不知道是否有适用于Windows的类似工具。