rubygems

How do I use frozen Capistrano part 2?

孤街浪徒 提交于 2019-12-11 19:07:38
问题 Following on from my question on using frozen Capistrano a couple of days back I'm still having issues running Capistrano frozen in my vendor folder. When I try and run my frozen version of cap ruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations I get an error ... RubyGem version error: net-ssh(1.0.8 not >= 2.0.0) (Gem::LoadError) ... I have net-ssh-2.0.4 frozen in my vendor folder as I knew it was a dependency so how do I make use of it? I'd hoped adding my vendor

How to generate create table migration file using Rails::Generators.invoke(“active_record:migration”)?

吃可爱长大的小学妹 提交于 2019-12-11 18:42:13
问题 When I used this code Rails::Generators.invoke("active_record:migration","create_tests",{:behavior=>:invoke, :destination_root=>Rails.root}) to generate migration file, I got the following class generated: class CreateTests < ActiveRecord::Migration def up end def down end end But what I want is this: class CreateTests < ActiveRecord::Migration def change create_table :tests do |t| t.timestamps end end end I'm not aware of what parameters I need to pass inside the invoke method. 回答1: You can

Bundle install error json gem

你。 提交于 2019-12-11 18:29:15
问题 I've got the following problem with ruby on rails v 5.1.6 (Ruby version 2.5.0), the most of the time I try to run the command bundle install on a rails project downloaded from github, I get the following error. Fetching gem metadata from http://rubygems.org/.......... Using rake 0.8.7z Using abstract 1.0.0 Using activesupport 3.0.7 Using builder 2.1.2 Using i18n 0.5.0 Using activemodel 3.0.7 Using erubis 2.6.6 Using rack 1.2.8 Using rack-mount 0.6.14 Using rack-test 0.5.7 Using tzinfo 0.3.37

How can I properly install bootsnap on windows

不问归期 提交于 2019-12-11 18:05:33
问题 I'm trying to install ruby on rails with rails installer. When I use "rails new blog" to get my feet wet on starting the web page, I keep getting a build error to build a native extension. I've also have similar problems installing sqlite3. The same issues appear on my laptop as well. (Both windows) So far I tried downloading this walkthrough (https://github.com/Shopify/bootsnap/issues/134), but get stuck when it tells me to do the script. I tried running the given script in irb as it said to

Ruby console application using text editor?

荒凉一梦 提交于 2019-12-11 17:53:04
问题 I'm building a console application in Ruby. One of the things I'd like it to do is edit text files. It strikes me that the most reasonable course of action would be to launch whatever default editor the user has set up -- nano, vi, emacs... let the user decide. I'd like to pass it the name of the file that will be created/edited. I've investigated various methods, including the backticks like so: response = `nano *nameoffile*` And I've also tried using the POpen4 Ruby gem, which also doesn't

how to optimise site load times in ruby?

和自甴很熟 提交于 2019-12-11 16:59:05
问题 I'm a newbie who is creating a lightweight photo showcase site written on the cake php framework with RoR.i plan to use effects from the scriptalicious library, as well as jquery for photo display & transition effects. As the site will be very photo-rich, what programming steps can i take to ensure that all photos and other pages load quickly? 回答1: i think you're mixing things up a bit. ror mixing with php/cake? so, about performance. it mostly depends on how many users do you think you'll

How to read text from file into an array in ruby

99封情书 提交于 2019-12-11 16:56:14
问题 Is there a way to treat the HOST, USER, PASS varibales in the net - ssh gem as an array and have multiple values for them? I currently have an outside text file with the HOST, USER AND PASS values, but i need to pass these into the aforementioned variables within the net - ssh gem. Any help and edits to clarify the question are appreciated! :) 回答1: You should be able to do this using the splat operator. Have a read around on this, but Google quickly returns this intro. Using this, you can

Rails has_secure_password cannot load such file — bcrypt

淺唱寂寞╮ 提交于 2019-12-11 16:50:19
问题 I'm trying to create simple authentication in Ruby on Rails. I'm currently stuck, because after creating table in database and adding in model has_secure_password I'm getting error LoadError: cannot load such file -- bcrypt . The error occur when I'm trying in rails console using basic command: User.all . I have looked at many solutions but nothing helped me. Currently I have installed bcrypt from https://github.com/codahale/bcrypt-ruby.git but still not working. Thank you in advance for your

How can I install a gem (via bundler using gemspec) before parsing the gemspec?

我的梦境 提交于 2019-12-11 16:17:55
问题 I have a gem that exists for the purpose of helping with versioning. It's useful to have this gem available when defining the version in the gemspec file. The problem, however, is that running bundle install first causes the gemspec to be parsed, which results in an error because the required gem isn't installed yet. I can get around it by running gem install <other_gem> before bundle install , but I'd much prefer bundler manage it, especially when taking into account that I'm using a custom

Rails requires RubyGems >= 0.9.4. Please install RubyGems

蓝咒 提交于 2019-12-11 15:43:47
问题 I'm deploying to Ubuntu slice on slicehost, using Rails 2.1.0 (from gem ) If I try mongrel_rails start or script/server I get this error: Rails requires RubyGems >= 0.9.4. Please install RubyGems When I type gem -v I have version 1.2.0 installed. Any quick tips on what to look at to fix? 回答1: Have you tried reinstalling RubyGems? I had a pretty similar error message until I reuninstalled and for some reason, it installed into a different directory and then the problem went away. 回答2: Just