标签: gem

即使安装了Rails控制台,也无法找到activesupport-4.1.2

当我运行Rails 4.1.2服务器时,我没有错误.

但是,如果我运行'rails c',我会收到以下错误:

Could not find activesupport-4.1.2 in any of the sources
Run `bundle install` to install missing gems.
Run Code Online (Sandbox Code Playgroud)

奇怪的是,activesupport-4.1.2已经安装并在Gemfile.lock中指定.我尝试过'捆绑更新'以及删除Gemfile.lock并运行'bundle install'.我也尝试在我的Rails gemfile中指定特定版本的ActiveSupport,但这已经无处可去了.

我真的很想使用最新的Rails,但是我不能使用控制台似乎很糟糕.

FIY:我在Linux中使用Ruby 2.1.2p95和RVM.

编辑:我卸载了所有activesupport宝石并重新安装4.1.2.这是'宝石列表activesupport说':

*** LOCAL GEMS ***

activesupport (4.1.2)
Run Code Online (Sandbox Code Playgroud)

同样的问题.

EDIT2:这是我的Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.2)
      actionpack (= 4.1.2)
      actionview (= 4.1.2)
      mail (~> 2.5.4)
    actionpack (4.1.2)
      actionview (= 4.1.2)
      activesupport (= 4.1.2)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.2)
      activesupport (= 4.1.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.2)
      activesupport (= 4.1.2) …
Run Code Online (Sandbox Code Playgroud)

ruby gem ruby-on-rails activesupport bundler

1
推荐指数
1
解决办法
2780
查看次数

无法在OS X Mavericks上安装libv8 gem

我在OS X Mavericks(10.9.4)上安装Ruby libv8 gem时遇到问题,我收到以下错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
creating Makefile
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/libv8-3.11.8.13/ext/libv8/compiler.rb:30: warning: Insecure world writable dir /usr/local/rvm/gems/ruby-2.0.0-p451/bin in PATH, mode 040777
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
Run Code Online (Sandbox Code Playgroud)

当使用以下内容时,我试图告诉clang不要输出错误,但无效但结果是相同的:

ARCHFLAGS=-Wno-error=unused-const-variable gem install libv8 -v '3.11.8.13'
Run Code Online (Sandbox Code Playgroud)

我错过了什么命令行选项?

谢谢

ruby gem osx-mavericks

1
推荐指数
1
解决办法
2079
查看次数

导入"波本威士忌"在Jekyll设置中不起作用

我正在使用Jekyll创建一个静态网站,并希望使用该框架Bourbon来构建我的CSS.

我已经安装了Jekyll并希望通过使用并运行将其添加到我的Gemfile来安装Bourbon.gem 'bourbon'bundle install

现在,当我将规则添加@import 'bourbon';到我的SCSS文件并开始运行Jekyll时,jekyll serve -w它启动了,但是当我修改我的SCSS文件时,Jekyll观察者抛出一个错误说:

    Regenerating: 1 files at 2014-07-03 10:00:11   `Conversion error: There was an error converting 'css/main.scss'.`
...error:
    Error: File to import not found or unreadable: bourbon. Load path: /Users/mark/Code/markdejong.com/mistermark.github.com.jekyll/_sass
    Error: Run jekyll build --trace for more information.
Run Code Online (Sandbox Code Playgroud)

这可能是什么问题?不应该像这样导入它或者杰基尔不支持这个吗?

ruby gem sass jekyll bourbon

1
推荐指数
1
解决办法
2949
查看次数

pry-warning错误:已初始化常量DEFAULT_HOOKS的前一个定义在这里

我整年都在终端使用撬没有任何问题.但是从昨晚开始,每当我在终端中键入pry时,它都不会打开,而是给我一个很长的错误记录.我尝试了几件事,花了很多时间搜索,但我迷路了,不知道接下来该做什么.我不明白为什么它给了我一些具有不同错误的ruby文件的行号,因为它通常在不与文件相关的情况下工作.日志有点长,但错误会重复出现.我把一切都放在重要的事情上.我非常感谢一些指导.

Last login: Wed Jul 23 10:35:32 on console
You have mail.
Sylvies-MacBook-Air:~ sylviecottrell$ pry
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:14: warning: already initialized constant Pry::DEFAULT_HOOKS
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:14: warning: previous definition of DEFAULT_HOOKS was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:20: warning: already initialized constant Pry::DEFAULT_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:20: warning: previous definition of DEFAULT_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:29: warning: already initialized constant Pry::SIMPLE_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:29: warning: previous definition of SIMPLE_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:38: warning: already initialized constant Pry::CLIPPED_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:38: warning: previous definition of CLIPPED_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:43: warning: already initialized constant Pry::DEFAULT_EXCEPTION_HANDLER
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:43: warning: previous …
Run Code Online (Sandbox Code Playgroud)

ruby gem rubygems

1
推荐指数
1
解决办法
1304
查看次数

如何减少宝石的大小

我目前正在创造一个宝石,它似乎比比较宝石大得多.

首先,这是一个真正的问题,如果是这样,有一种特殊的方法来减少宝石的大小?

宝石:https://rubygems.org/gems/roroacms

Github:https://github.com/roroacms/roroacms

gem ruby-on-rails

1
推荐指数
1
解决办法
446
查看次数

如何在Rails 4中创建优惠券代码生成器

谁能建议任何方式来生成rails 4的优惠券代码?它使用条带作为支付解决方案从零开始的电子商务应用程序?

ruby gem ruby-on-rails e-commerce

1
推荐指数
1
解决办法
1197
查看次数

似乎无法使用Rails 4安装rubocop gem

我尝试通过将建议的行添加到我的Rails项目的Gemfile来安装rubocop:

gem 'rubocop', require: false

运行后bundle,它会安装并在我的Gemfile.lock中可见.

但是,当$ rubocop从我的应用程序的根运行时,我收到此错误:

-bash: rubocop: command not found

我试过跑步$ which rubocop,什么都没发生.

我也试过跑步$ gem install rubocop,行为没有区别.

以下是我的Gemfile.lock的摘录:

rubocop (0.27.0)
  astrolabe (~> 1.3)
  parser (>= 2.2.0.pre.6, < 3.0)
  powerpack (~> 0.0.6)
  rainbow (>= 1.99.1, < 3.0)
  ruby-progressbar (~> 1.4)
Run Code Online (Sandbox Code Playgroud)

ruby gem ruby-on-rails

1
推荐指数
1
解决办法
1387
查看次数

rake无法加载这样的文件(LoadError)

rake尝试安装时遇到一个奇怪的错误,这就是它所说的

$ rake bundle_install
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/1.9.1/gems/rake-10.0.4/bin/rake (LoadError)
        from /usr/local/bin/rake:23:in `<main>'
Run Code Online (Sandbox Code Playgroud)

当我尝试导航到目录时,我什么也没找到:

$ ls /usr/share/rubygems-integration/1.9.1/
specifications/
Run Code Online (Sandbox Code Playgroud)

Ruby版本:

$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Run Code Online (Sandbox Code Playgroud)

为什么它试图加载错误的版本以及如何解决这个问题?

ruby rake gem ruby-on-rails bundler

1
推荐指数
1
解决办法
8475
查看次数

安装Ruby Gem不适用于OSX 10.10 Yosemite

我正在尝试通过Mac终端安装Github Linguist ruby​​ gem.

我没有足够的积分来上传图片所以请耐心等待.

这是我在终端中安装它时显示的错误: -

bash-3.2# gem install github-linguist

构建原生扩展.这可能需要一段时间......

错误:安装github-linguist时出错:

错误:无法构建gem原生扩展.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150321-444-15aw05d.rb extconf.rb
Run Code Online (Sandbox Code Playgroud)

检查gmake ...没有检查make ...是检查cmake ...没有错误:需要CMake来构建Rugged. *extconf.rb失败* 由于某些原因无法创建Makefile,可能缺少必要的库和/或标头.检查mkmf.log文件以获取更多详细信息.您可能需要配置选项.

提供的配置选项:

--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--use-system-libraries
Run Code Online (Sandbox Code Playgroud)

extconf失败,退出代码1

Gem文件将保留在/Library/Ruby/Gems/2.0.0/gems/rugged-0.22.1b1中进行检查.结果记录到/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/rugged-0.22.1b1/gem_make.out

ruby macos installation gem package

1
推荐指数
1
解决办法
1369
查看次数

如何解决bundle install rake error和Gem :: RemoteFetcher :: FetchError

当我bundle install在ruby 2.1.2上运行时,我得到:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

当我跑步时,gem install rake我得到:

ERROR:  Could not find a valid gem 'bundle' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Run Code Online (Sandbox Code Playgroud)

当我跑步时,which bundle我得到: …

ruby gem rubygems ruby-on-rails ruby-on-rails-3

1
推荐指数
1
解决办法
9297
查看次数