【问题标题】:RubyMine errors after creating 'Rails application' project创建“Rails 应用程序”项目后的 RubyMine 错误
【发布时间】:2011-03-25 19:53:36
【问题描述】:

我已经下载并安装了“rubyinstaller-1.9.2-p180.exe”,然后我安装了 gems(rubygems-1.6.2 通过运行 'ruby setup.rb') 并通过运行 'gem install rails' 安装了 rails '。 完成所有这些之后,我已经下载并安装了 RubyMine 3.1

在 RubyMine 中,我尝试创建新的“Rails 应用程序”项目,在“Rails 应用程序设置”对话框中,它显示上面安装的 rub 作为 Ruby 解释器,Rails 版本显示为“3.0.5”。 Rails 模板为空。 'Preconfigure for selected databases' 未选中,并且“skip test:unit files” 也未选中。

点击确定后,它会在代码顶部创建一些文件,有一条消息“一些必需的 getms 附注:sqlite3”(我没有问 DB,为什么要使用 sqlite??)无论如何我点击, 在“附加宝石”上。

之后我点击播放图标,并得到以下错误。请帮我解决这个问题。提前致谢!

------------------------------
C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/kobi/RubymineProjects/deded/script/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
from C:/Users/kobi/RubymineProjects/deded/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `require'
from C:/Users/kobi/RubymineProjects/deded/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'

Process finished with exit code 1

【问题讨论】:

    标签: ruby-on-rails rubymine


    【解决方案1】:

    RubyInstaller for Ruby 1.9.2 不支持任何其他 RubyGems 版本,除了 RubyInstaller 附带的版本。通过更新 RubyGems,您会破坏您的 Ruby 安装。请将 Ruby 重新安装到干净的目录中,并且不要更新 RubyGems。

    此外,您的 PATH 环境中似乎缺少 sqlite3.dll。 Download 并解压到 RUBY_HOME\bin 或 c:\windows\system32。 Rails 需要一些数据库,而 sqlite 是默认的。

    某些原生 gem 扩展可能需要安装 DevKit,如果您在安装此类 gem 时遇到问题,请先install DevKit

    【讨论】:

    • 谢谢。我重新安装了 ruby​​,并且必须安装 rails 框架('gem install rails' 否则 RubyMine 不会创建 RoR 项目。)并且有同样的错误。然后在下载并将sqlite dll放入路径后,它就开始工作了。如果 ruby​​ 给出的错误更清晰(例如'dll X is missing')会更好
    【解决方案2】:

    从控制台试试这个:

    cd C:/users/kobi/rubymineprojects/deded
    bundle install
    

    【讨论】:

    • 没有帮助,同样的错误。 (捆绑命令本身成功完成)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-14
    相关资源
    最近更新 更多