col*_*lin 1 ruby bundle ruby-on-rails ruby-on-rails-3
我遇到了麻烦,在Rails项目中?redmine2.3),rails版本是3.2
开始项目
bundle exec thin start -p 8080 -e production -s 5 -d
Run Code Online (Sandbox Code Playgroud)
错误信息
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
/var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `require': libruby.so.2.0: cannot open shared object file: No such file or directory - /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/rubyeventmachine.so (LoadError)
from /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `load'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `<main>'
Run Code Online (Sandbox Code Playgroud)
运行时发生相同的错误 rails -v
rails -v
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
Run Code Online (Sandbox Code Playgroud)
bundle exec .....
在项目中运行会产生相同的错误
问题解决了,请看我在三楼的评论,有答案
Jer*_*yal 19
对于 Windows 10 上的 Ruby 2.4 和 eventmachine 1.2.6。
您必须先卸载eventmachine
,然后使用平台 ruby 再次安装它:
gem uninstall eventmachine (select all versions if prompted)
gem install eventmachine --platform ruby
Run Code Online (Sandbox Code Playgroud)
Sim*_*ast 13
我在 Windows 10 上尝试使用 Jekyll 的 LiveReload 功能时遇到此错误消息。这里的其他答案并没有完全解决问题,或者有下次bundle install
运行时再次出现问题的风险。
我的解决方案(取自本网站)是:
运行此控制台命令
gem uninstall eventmachine
Run Code Online (Sandbox Code Playgroud)
并选择eventmachine-1.2.7-x64-mingw32
从您的系统中卸载gems。
Gemfile
在您的项目目录中编辑并在其中添加以下行:
gem 'eventmachine', '1.2.7', git: 'https://github.com/eventmachine/eventmachine.git', tag: 'v1.2.7'
Run Code Online (Sandbox Code Playgroud)
跑
bundle install
Run Code Online (Sandbox Code Playgroud)
使用命令清理你的 jekyll 构建和缓存
bundle exec jekyll clean
Run Code Online (Sandbox Code Playgroud)
您现在可以使用该--livereload
参数而不会出现任何问题,即使您bundle install
将来执行也是如此。
如果您使用的是Windows
转到此文件夹 C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\eventmachine-1.2.5-x64-mingw32\lib
打开此文件eventmachine.rb
require 'em/pure_ruby'
在文件的第一行代码中这将使其没有问题。
此处的相关错误消息如下:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
Run Code Online (Sandbox Code Playgroud)
尝试重新安装eventmachine
gem:
gem uninstall eventmachine
bundle install
Run Code Online (Sandbox Code Playgroud)
请参阅创建数据库时的 Rails/Ruby 错误:无法加载 EventMachine C 扩展 和 Rails - 无法运行应用程序:无法加载 EventMachine C 扩展;有关如何处理此问题的更多建议。
归档时间: |
|
查看次数: |
8176 次 |
最近记录: |