rubygems

Rouge gem minimal example not showing formatting?

爷,独闯天下 提交于 2019-12-20 07:55:43
问题 I have followed the simple instructions in part A) of this answer. The code can be seen in the browser, but it's not formatted as it's supposed to be. When I view source, I can see that css classes are being generated, but it doesn't seem to change the appearance. This is the html generated (I added the div's) <div class="highlight"> <span class="k">def</span> <span class="nf">rouge_me</span> <span class="nb">puts</span> <span class="s1">'hey!'</span> <span class="k">end</span><br><br> </div>

error saying “autocomplete method doesn't exist” with rails3-autocomplete gem

北城余情 提交于 2019-12-20 07:28:52
问题 In my rails application I am trying to use rails3-jquery-autocomplete gem. I included the following line in Gemfile. 'gem rails3-jquery-autocomplete' and gave bundle install and its listed in the gems. My controller : class ReleasesController < AuthorizedController # GET /releases # GET /releases.xml autocomplete :users, :name def new @release = Release.new @ic_ids = params[:ic_ids] ? params[:ic_ids] : [] @testers = User.find_by_sql("select * from users where id in(select user_id from user

ERROR: Missing RVM environment file After Doing rvm upgrade command - Passenger 4.0.23

∥☆過路亽.° 提交于 2019-12-20 06:08:11
问题 I was running ruby 2.0.0-p247 on my Mac Mini Server (Mavericks 10.9.1). I read that there was a security vulnerability so I decided to upgrade to use the latest Ruby patch 2.0.0-p353. I did the following commands: gem update --system (RubyGems 2.1.11) rvm get stable (RVM 1.25.0) rvm upgrade 2.0.0-p247 2.0.0-p353 (which should have moved my gemsets) There is nothing in my system that I can find that references 2.0.0-p247 in rvm which is what I expected. When I go to ~/myuser/.rvm/environments

PG::InvalidParameterValue: ERROR: invalid value for parameter “client_min_messages”: “panic”

喜夏-厌秋 提交于 2019-12-20 05:17:10
问题 rake db:create showing error PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic" HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error. After bundle install tried to run rake db:create commond. Created database.yml file inside the config folder please find below : development: adapter: postgresql encoding: utf8 database: thor_development1 username: postgres password: host: localhost test: adapter: postgresql

Any ruby library to inspect what are the arguments that a certain methods take?

 ̄綄美尐妖づ 提交于 2019-12-20 03:04:26
问题 is there any library that can inspect and display what are the arguments that a method takes? 回答1: I don't know of any third-party libraries or even RubyGems that can do this reliably. It just isn't possible to do this kind of inspection given the limited reflection facilities Ruby provides. You will have to make do with what is available in the core library, which is basically Method#parameters: def foo(a, b=nil, *c, d, &e); end method(:foo).parameters # => [[:req, :a], [:opt, :b], [:rest,

uninitialized constant Twitter (NameError)

本秂侑毒 提交于 2019-12-20 02:58:08
问题 Hey guys i have a problem i am facing with the twitter gem. I have a file (twitter.rb) with this content require "rubygems" require "twitter" puts Twitter.user_timeline("roykasa").first.text puts Twitter.user("roykasa").location search = Twitter::Search.new search.containing("hate").to("StewieJokess"). result_type("recent").each do |r| puts r.text end When i run the file i get this error : uninitialized constant Twitter (NameError) I read somewhere on SO where a user had a similar problem and

RVM - Not able to use gems from the @global gemset

◇◆丶佛笑我妖孽 提交于 2019-12-20 02:26:06
问题 I'm having an issue with RVM. In general I use project specific gemsets; however, recently when I install a gem into the @global gemset, it is not available when I'm working in a particular project. Here is an example where I was trying to install the hpricot gem. This is right after installing the gem and starting a fresh shell. $ rvm use ruby-1.9.2 Using /home/bshaver/.rvm/gems/ruby-1.9.2-p180 $ gem list *** LOCAL GEMS *** bundler (1.0.12) hpricot (0.8.4) rake (0.8.7) $ rvm use ruby-1.9.2

Error when trying to create Heroku app on Windows

孤者浪人 提交于 2019-12-20 01:55:13
问题 When I try to do heroku create I get the following error message: d:/Ruby187/lib/ruby/gems/1.8/gems/heroku-2.0.1/lib/heroku/command/base.rb:83:in 'read': No such file or directory -d (Errno::ENOENT) from d:/Ruby187/lib/ruby/gems/1.8/gems/heroku-2.0.1/lib/heroku/command/base.rb:83:in 'extract_help' from d:/Ruby187/lib/ruby/gems/1.8/gems/heroku-2.0.1/lib/heroku/command/base.rb:51:in 'method_added' from d:/Ruby187/lib/ruby/gems/1.8/gems/heroku-2.0.1/lib/heroku/command/addons.rb:14 from d:

Gem install wrong number of arguments (given 1, expected 0)

最后都变了- 提交于 2019-12-20 01:11:25
问题 When I run bundle , I get the following: The `bundle' command exists in these Ruby versions: 2.1.8 2.4.2 jruby-9.1.15.0 My project uses Ruby-2.5.1, so I'm trying to update my bundler using gem install bundler , but I get the following error: ERROR: While executing gem ... (ArgumentError) wrong number of arguments (given 1, expected 0) Using --backtrace /Users/spencerbailey/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:47:in `require' /Users/spencerbailey/

Why does the Gemfile semantic versioning operator (~>) produce inconsistent results with one number?

China☆狼群 提交于 2019-12-19 18:16:12
问题 The gemspec semantic versioning operator ~> (aka twiddle-wakka, aka pessimistic operator) allows a gem version to be constrained yet allow some upgrades. I have often seen that it can be read as: "~> 3.1" => "Any version 3.x, but at least 3.1" "~> 3.1.1" => "Any version 3.1.x, but at least 3.1.1" But with one number, this rule breaks down: "~> 3" => "Any version x, but at least 3" *NOT TRUE!* "~> 3" => "Any version 3.x" *True. But why?* If I wanted "Any version 3.x", I could just use "~> 3.0"