除了Rails和其他Web开发框架之外,Ruby还有其他实际/商业用途吗?
我想知道Ruby应用于什么其他应用程序,作为通用编程语言.
以下命令下载1.7.2,但我需要提取最新版本.我该怎么办?
rvm install jruby
http://jruby.org.s3.amazonaws.com/downloads/1.7.2/jruby-bin-1.7.2.tar.gz - #configure
jruby-1.7.2 - #download
Run Code Online (Sandbox Code Playgroud) 我的 SonarQube 在 Microsoft Azure 的 VM 实例上运行。现在 SonarQube 的数据库是 MySQL,我正在尝试将 MySQL 更改为 Azure SQL 数据库,但是由于 ActiveRecord 组件中发生的一些错误,SonarQube 无法连接 Azure SQL 数据库。我知道 SonarQube 不正式支持 Azure SQL 数据库并支持下面的 SQL Server,但是 Azure SQL 数据库与 SQL Server 兼容,因此可以连接 Azure SQL 数据库。如果有人知道,请告诉我如何连接 Azure SQL 数据库。
sonar.properties:
sonar.jdbc.username=sonar@<server>
sonar.jdbc.password=<password>
sonar.jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc:jtds:sqlserver://<server>.database.windows.net:1433/<databasename>;ssl=require
Run Code Online (Sandbox Code Playgroud)
错误跟踪:
org.jruby.rack.RackInitializationException: no connection available
from arjdbc/jdbc/RubyJdbcConnection.java:517:in `set_native_database_types'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/connection.rb:61:in `initialize'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:31:in `initialize'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/connection_methods.rb:6:in `jdbc_connection'
from org/jruby/RubyKernel.java:2227:in `send'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from /opt/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from org/jruby/RubyKernel.java:1519:in `loop' …Run Code Online (Sandbox Code Playgroud) 究竟为什么将浮点值 1.0 与整数值 1 进行比较会返回 true?
puts '1.0'.to_i
puts '1.0'.to_i == 1.0 #so 1 == 1.0 is true?
puts 1.0 == 1 #wtf?
Run Code Online (Sandbox Code Playgroud)
Ruby是否只读取浮点值的第一部分然后短路?有人可以通过一些文档的链接进行解释吗?我翻阅了 API,但我什至不知道在这种情况下要寻找什么......
我得到了最新的源代码.我将jruby-1.7.2/bin子目录路径添加到$ PATH.
现在,当我跑
$jirb
Run Code Online (Sandbox Code Playgroud)
要么
$jruby -v
Run Code Online (Sandbox Code Playgroud)
我收到错误:"找不到Java类:org.jruby.Main
我的Java版本是1.4.2
我错过了什么?