- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是一名新手,渴望接触 Ruby on Rails (OSX 10.7)。但首先我需要安装它。现在我花了 9 个小时试图让它工作,但当我尝试创建一个新项目时它总是失败:
$ rails new /Users/tom/Documents/14-Utveckling/WhichTerminal
exist
identical README.rdoc
identical Rakefile
identical config.ru
identical .gitignore
conflict Gemfile
Overwrite /Users/tom/Documents/14-Utveckling/WhichTerminal/Gemfile? (enter "h" for help) [Ynaqdh] Y
force Gemfile
exist app
identical app/assets/images/rails.png
identical app/assets/javascripts/application.js
identical app/assets/stylesheets/application.css
identical app/controllers/application_controller.rb
identical app/helpers/application_helper.rb
exist app/mailers
exist app/models
identical app/views/layouts/application.html.erb
identical app/mailers/.gitkeep
identical app/models/.gitkeep
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
exist config/environments
identical config/environments/development.rb
identical config/environments/production.rb
identical config/environments/test.rb
exist config/initializers
identical config/initializers/backtrace_silencers.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
conflict config/initializers/secret_token.rb
Overwrite /Users/tom/Documents/14- Utveckling/WhichTerminal/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] Y
force config/initializers/secret_token.rb
conflict config/initializers/session_store.rb
Overwrite /Users/tom/Documents/14-Utveckling/WhichTerminal/config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] Y
force config/initializers/session_store.rb
conflict config/initializers/wrap_parameters.rb
Overwrite /Users/tom/Documents/14-Utveckling/WhichTerminal/config/initializers/wrap_parameters.rb? (enter "h" for help) [Ynaqdh] Y
force config/initializers/wrap_parameters.rb
exist config/locales
identical config/locales/en.yml
identical config/boot.rb
identical config/database.yml
exist db
conflict db/seeds.rb
Overwrite /Users/tom/Documents/14-Utveckling/WhichTerminal/db/seeds.rb? (enter "h" for help) [Ynaqdh] Y
force db/seeds.rb
exist doc
identical doc/README_FOR_APP
exist lib
exist lib/tasks
identical lib/tasks/.gitkeep
exist lib/assets
identical lib/assets/.gitkeep
exist log
identical log/.gitkeep
exist public
identical public/404.html
identical public/422.html
identical public/500.html
identical public/favicon.ico
identical public/index.html
identical public/robots.txt
exist script
identical script/rails
exist test/fixtures
identical test/fixtures/.gitkeep
exist test/functional
identical test/functional/.gitkeep
exist test/integration
identical test/integration/.gitkeep
exist test/unit
identical test/unit/.gitkeep
identical test/performance/browsing_test.rb
identical test/test_helper.rb
exist tmp/cache
exist tmp/cache/assets
exist vendor/assets/javascripts
identical vendor/assets/javascripts/.gitkeep
exist vendor/assets/stylesheets
identical vendor/assets/stylesheets/.gitkeep
exist vendor/plugins
identical vendor/plugins/.gitkeep
run bundle install
Enter your password to install the bundled RubyGems to your system:
Fetching gem metadata from https://rubygems.org/.........
NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
我的理论:
我怀疑是 https 访问出错了。 Some说这是 openssl 的问题。
$ openssl version
OpenSSL 0.9.8r 8 Feb 2011
显然,最佳答案是“OpenSSL 1.0.1”,但我不知道如何全局更新 Openssl。忽略这一点,我确实重新安装了 ruby,并执行了以下操作:
$ rvm remove 1.9.3
$ brew install openssl
$ rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl`
我不知道 brew 做了什么,但它似乎安装了 openssl 并将其隐藏在某个目录中。反正。无论我做什么,我总是以同样的错误结束:
Fetching gem metadata from https://rubygems.org/.........
NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
我重新安装了整个 chabang。同样的结果。这是日志:
删除虚拟机
$ rvm implode
[...]
rvm has been fully removed. Note you may need to manually remove /etc/rvmrc and ~/.rvmrc if they exist still.
$ gem uninstall rvm
$ which ruby
/usr/bin/ruby
安装 RVM
$ curl -L get.rvm.io | bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9248 100 9248 0 0 2403 0 0:00:03 0:00:03 --:--:-- 27939
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1023k 100 1023k 0 0 85026 0 0:00:12 0:00:12 --:--:-- 94532
Installing RVM to /Users/tom/.rvm/
RVM PATH line found in /Users/tom/.bashrc /Users/tom/.zshrc.
RVM sourcing line found in /Users/tom/.bash_login /Users/tom/.zlogin.
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm/
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'
Installation of RVM in /Users/tom/.rvm/ is almost complete:
* To start using RVM you need to run `source /Users/tom/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Tom Eriksen,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne
rvm 1.13.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
安装 Ruby 1.9.3(使用 openssl 1.0.1)
$ rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl`
Fetching yaml-0.1.4.tar.gz to /Users/tom/.rvm/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 460k 100 460k 0 0 65747 0 0:00:07 0:00:07 --:--:-- 116k
Extracting yaml-0.1.4.tar.gz to /Users/tom/.rvm/src
Configuring yaml in /Users/tom/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/tom/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/tom/.rvm/usr
Installing Ruby from source to: /Users/tom/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #fetching
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9610k 100 9610k 0 0 193k 0 0:00:49 0:00:49 --:--:-- 212k
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /Users/tom/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #extracted to /Users/tom/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #configuring
ruby-1.9.3-p194 - #compiling
ruby-1.9.3-p194 - #installing
Retrieving rubygems-1.8.24
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 371k 100 371k 0 0 355k 0 0:00:01 0:00:01 --:--:-- 446k
Extracting rubygems-1.8.24 ...
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.3-p194 ...
Installation of rubygems completed successfully.
ruby-1.9.3-p194 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p194 - #importing default gemsets (/Users/tom/.rvm/gemsets/)
Install of ruby-1.9.3-p194 - #complete
$ which ruby
/Users/tom/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
$ which gem
/Users/tom/.rvm/rubies/ruby-1.9.3-p194/bin/gem
$ which rails
/usr/bin/rails
安装 RubyGems 以防万一。通过 GIT 下载 RubyGems 后,我移动到目录并运行安装程序。
$ cd /Users/tom/Library/Developer/rubygems
Toms-dator-2:rubygems tom$ ruby setup.rb
RubyGems 2.0.a installed
------------------------------------------------------------------------------
RubyGems installed the following executables:
/Users/tom/.rvm/rubies/ruby-1.9.3-p194/bin/gem
rubygems$ gem update --system
Latest version currently installed. Aborting.
正在安装 json(如果我不安装它会报错)
rubygems$ gem install json
Fetching: json-1.7.3.gem (100%)
Building native extensions. This could take a while...
Successfully installed json-1.7.3
Installing ri documentation for json-1.7.3
Installing darkfish documentation for json-1.7.3
1 gem installed
Rubygems$ which gem
/Users/tom/.rvm/rubies/ruby-1.9.3-p194/bin/gem
安装 rails
Rubygems$ gem install rails
Fetching: i18n-0.6.0.gem (100%)
Successfully installed i18n-0.6.0
Fetching: multi_json-1.3.5.gem (100%)
Successfully installed multi_json-1.3.5
Fetching: activesupport-3.2.3.gem (100%)
Successfully installed activesupport-3.2.3
Fetching: builder-3.0.0.gem (100%)
Successfully installed builder-3.0.0
Fetching: activemodel-3.2.3.gem (100%)
Successfully installed activemodel-3.2.3
Fetching: rack-1.4.1.gem (100%)
Successfully installed rack-1.4.1
Fetching: rack-cache-1.2.gem (100%)
Successfully installed rack-cache-1.2
Fetching: rack-test-0.6.1.gem (100%)
Successfully installed rack-test-0.6.1
Fetching: journey-1.0.3.gem (100%)
Successfully installed journey-1.0.3
Fetching: hike-1.2.1.gem (100%)
Successfully installed hike-1.2.1
Fetching: tilt-1.3.3.gem (100%)
Successfully installed tilt-1.3.3
Fetching: sprockets-2.1.3.gem (100%)
Successfully installed sprockets-2.1.3
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: actionpack-3.2.3.gem (100%)
Successfully installed actionpack-3.2.3
Fetching: arel-3.0.2.gem (100%)
Successfully installed arel-3.0.2
Fetching: tzinfo-0.3.33.gem (100%)
Successfully installed tzinfo-0.3.33
Fetching: activerecord-3.2.3.gem (100%)
Successfully installed activerecord-3.2.3
Fetching: activeresource-3.2.3.gem (100%)
Successfully installed activeresource-3.2.3
Fetching: mime-types-1.18.gem (100%)
Successfully installed mime-types-1.18
Fetching: polyglot-0.3.3.gem (100%)
Successfully installed polyglot-0.3.3
Fetching: treetop-1.4.10.gem (100%)
Successfully installed treetop-1.4.10
Fetching: mail-2.4.4.gem (100%)
Successfully installed mail-2.4.4
Fetching: actionmailer-3.2.3.gem (100%)
Successfully installed actionmailer-3.2.3
Fetching: thor-0.14.6.gem (100%)
Successfully installed thor-0.14.6
Fetching: rack-ssl-1.3.2.gem (100%)
Successfully installed rack-ssl-1.3.2
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-3.12
Fetching: railties-3.2.3.gem (100%)
Successfully installed railties-3.2.3
Fetching: rails-3.2.3.gem (100%)
Successfully installed rails-3.2.3
Installing ri documentation for i18n-0.6.0
Installing darkfish documentation for i18n-0.6.0
Installing ri documentation for multi_json-1.3.5
Installing darkfish documentation for multi_json-1.3.5
Installing ri documentation for activesupport-3.2.3
Installing darkfish documentation for activesupport-3.2.3
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README.rdoc, skipping
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/performance.rb, skipping
Installing ri documentation for builder-3.0.0
Installing darkfish documentation for builder-3.0.0
Installing ri documentation for activemodel-3.2.3
Installing darkfish documentation for activemodel-3.2.3
unable to convert "\x89" from ASCII-8BIT to UTF-8 for test/multipart/binary, skipping
Installing ri documentation for rack-1.4.1
Installing darkfish documentation for rack-1.4.1
Installing ri documentation for rack-cache-1.2
Installing darkfish documentation for rack-cache-1.2
Installing ri documentation for rack-test-0.6.1
Installing darkfish documentation for rack-test-0.6.1
Installing ri documentation for journey-1.0.3
Installing darkfish documentation for journey-1.0.3
Installing ri documentation for hike-1.2.1
Installing darkfish documentation for hike-1.2.1
Installing ri documentation for tilt-1.3.3
Installing darkfish documentation for tilt-1.3.3
Installing ri documentation for sprockets-2.1.3
Installing darkfish documentation for sprockets-2.1.3
Installing ri documentation for erubis-2.7.0
Installing darkfish documentation for erubis-2.7.0
Installing ri documentation for actionpack-3.2.3
Installing darkfish documentation for actionpack-3.2.3
Installing ri documentation for arel-3.0.2
Installing darkfish documentation for arel-3.0.2
Installing ri documentation for tzinfo-0.3.33
Installing darkfish documentation for tzinfo-0.3.33
Installing ri documentation for activerecord-3.2.3
Installing darkfish documentation for activerecord-3.2.3
Installing ri documentation for activeresource-3.2.3
Installing darkfish documentation for activeresource-3.2.3
Installing ri documentation for mime-types-1.18
Installing darkfish documentation for mime-types-1.18
Installing ri documentation for polyglot-0.3.3
Installing darkfish documentation for polyglot-0.3.3
Installing ri documentation for treetop-1.4.10
Installing darkfish documentation for treetop-1.4.10
Installing ri documentation for mail-2.4.4
Installing darkfish documentation for mail-2.4.4
Installing ri documentation for actionmailer-3.2.3
Installing darkfish documentation for actionmailer-3.2.3
Installing ri documentation for thor-0.14.6
Installing darkfish documentation for thor-0.14.6
Installing ri documentation for rack-ssl-1.3.2
Installing darkfish documentation for rack-ssl-1.3.2
Installing ri documentation for rdoc-3.12
Installing darkfish documentation for rdoc-3.12
Installing ri documentation for railties-3.2.3
Installing darkfish documentation for railties-3.2.3
Installing ri documentation for rails-3.2.3
Installing darkfish documentation for rails-3.2.3
28 gems installed
Rubygems$ which rails
/Users/tom/.rvm/gems/ruby-1.9.3-p194/bin/rails
最后。让我们创建一个新项目
Rubygems$ rails new /Users/tom/Documents/WhichTerminal
exist
create README.rdoc
create Rakefile
create config.ru
identical .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
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/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/.........
NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
Rubygems$
同样的结果。怎么了?
最佳答案
我会在这里尝试两件事。
首先,确保 Rails 命令从正确的位置运行:听起来您可能没有使用正确版本的 Rails。 which rails
应该向您显示该文件来自您的 RVM 安装:如果不是,您需要确保您 rvm 使用 1.9.3
然后尝试再次 gem install rails
。
其次,因为这个错误听起来类似于旧版本 gem 中发生的错误,所以我会尝试更新您的 gem 二进制文件。首先,就像在 Rails 中一样,键入 which gem
以确保您使用的是 RVM gem,而不是系统 gem。然后,在再次捆绑安装之前执行 gem update --system
。
关于ruby-on-rails - 无法让 'rails new' 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10741174/
我在Windows 10中使用一些简单的Powershell代码遇到了这个奇怪的问题,我认为这可能是我做错了,但我不是Powershell的天才。 我有这个: $ix = [System.Net.Dn
var urlsearch = "http://192.168.10.113:8080/collective-intellegence/StoreClicks?userid=" + userId +
我有一个非常奇怪的问题,过去两天一直让我抓狂。 我有一个我试图控制的串行设备(LS 100 光度计)。使用设置了正确参数的终端(白蚁),我可以发送命令(“MES”),然后是定界符(CR LF),然后我
我目前正试图让无需注册的 COM 使用 Excel 作为客户端,使用 .NET dll 作为服务器。目前,我只是试图让概念验证工作,但遇到了麻烦。 显然,当我使用 Excel 时,我不能简单地使用与可
我开发了简单的 REST API - https://github.com/pavelpetrcz/MandaysFigu - 我的问题是在本地主机上,WildFly 16 服务器的应用程序运行正常。
我遇到了奇怪的情况 - 从 Django shell 创建一些 Mongoengine 对象是成功的,但是从 Django View 创建相同的对象看起来成功,但 MongoDB 中没有出现任何数据。
我是 flask 的新手,只编写了一个相当简单的网络应用程序——没有数据库,只是一个航类搜索 API 的前端。一切正常,但为了提高我的技能,我正在尝试使用应用程序工厂和蓝图重构我的代码。让它与 pus
我的谷歌分析 JavaScript 事件在开发者控制台中运行得很好。 但是当从外部 js 文件包含在页面上时,它们根本不起作用。由于某种原因。 例如; 下面的内容将在包含在控制台中时运行。但当包含在单
这是一本名为“Node.js 8 the Right Way”的书中的任务。你可以在下面看到它: 这是我的解决方案: 'use strict'; const zmq = require('zeromq
我正在阅读文本行,并创建其独特单词的列表(在将它们小写之后)。我可以使它与 flatMap 一起工作,但不能使它与 map 的“子”流一起工作。 flatMap 看起来更简洁和“更好”,但为什么 di
我正在编写一些 PowerShell 脚本来进行一些构建自动化。我发现 here echo $? 根据前面的语句返回真或假。我刚刚发现 echo 是 Write-Output 的别名。 写主机 $?
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我将一个工作 View Controller 类从另一个项目复制到一个新项目中。我无法在新项目中加载 View 。在旧项目中我使用了presentModalViewController。在新版本中,我
我对 javascript 很陌生,所以很难看出我哪里出错了。由于某种原因,我的功能无法正常工作。任何帮助,将不胜感激。我尝试在外部 js 文件、头部/主体中使用它们,但似乎没有任何效果。错误要么出在
我正在尝试学习Flutter中的复选框。 问题是,当我想在Scaffold(body :)中使用复选框时,它正在工作。但我想在不同的地方使用它,例如ListView中的项目。 return Cente
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我有一个组合框,其中包含一个项目,比如“a”。我想调用该组合框的 Action 监听器,仅在手动选择项目“a”完成时才调用。我也尝试过 ItemStateChanged,但它的工作原理与 Action
你能看一下照片吗?现在,一步前我执行了 this.interrupt()。您可以看到 this.isInterrupted() 为 false。我仔细观察——“这个”没有改变。它具有相同的 ID (1
我们当前使用的是 sleuth 2.2.3.RELEASE,我们看不到在 http header 中传递的 userId 字段没有传播。下面是我们的代码。 BaggageField REQUEST_I
我正在尝试在我的网站上设置一个联系表单,当有人点击发送时,就会运行一个作业,并在该作业中向所有管理员用户发送通知。不过,我在失败的工作表中不断收到此错误: Illuminate\Database\El
我是一名优秀的程序员,十分优秀!