Tag: gemset

如何使用rvm将rails 3.2 app从ruby 1.9.3升级到ruby 2.1.5

我的Rails 3.2 / Ruby 1.9.3应用程序正在使用RVM。 我想升级到使用ruby 2.1.5。 我也使用RVM来安装Ruby 2.1.5。 所以rvm list显示了1.9.3和2.1.5 我的项目目录有一个.rvmrc文件指定 environment_id = “ruby-1.9.3-p551@current_foogems” 所以我有一个名为current_foogems的gemset 如何切换我的项目以使用ruby 2.1.5? 我复制gem吗? 创建一个新的(空)gemset? 鉴于ruby版本从1.9.3跳到2.1.5,这可能意味着我应该重新编译gem,我认为安全的方法可能是: i) create a new blank gemset ‘new_foogems’ ii) edit the .rvmrc file to use “ruby-2.1.5@new_foogems” iii) run bundle install to re-create all-new gems in the new gemset

生产轨道部署中的两个版本的gem

我认为我的生产中的gemfile存在一些问题,因为它与我的开发不同,我认为这导致我的部署(Capistrano)失败,至少在捆绑安装时间 发展 actionmailer (3.2.3) actionpack (3.2.3) activemodel (3.2.3) activerecord (3.2.3) activeresource (3.2.3) activesupport (3.2.3) arel (3.0.2) bcrypt-ruby (3.0.1) builder (3.0.4) bundler (1.3.4) capistrano (2.14.2, 2.12.0) climate_control (0.0.3) cocaine (0.5.1, 0.2.1) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.6.2, 1.3.3) commonjs (0.2.6) daemon_controller (1.1.2, 1.0.0) daemons (1.1.9) database_cleaner (0.9.1, 0.8.0) devise (2.2.3) diff-lcs (1.2.2, 1.1.3) erubis (2.7.0) eventmachine […]

Gemset:此系统上当前未安装Rails。

macbook$ rvm gemset list_all gemsets for ruby-1.9.2-p320 (found in /Users/macbook/.rvm/gems/ruby-1.9.2-p320) global gemsets for ruby-1.9.3-p194 (found in /Users/macbook/.rvm/gems/ruby-1.9.3-p194) nice global macbook$ rvm use ruby-1.9.3-p194@nice Using /Users/macbook/.rvm/gems/ruby-1.9.3-p194@nice with gemset global macbook$ rails –version Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun […]

使用RVM Gemsets&Bundler和RubyMine

我使用RVM来管理Ruby版本。 在我的项目中,我使用Bundler来管理项目的gem。 RVM也有gemsets。 gemset中的Gem与Bundler的gem没有关联。 ←这是对的吗? 我得出了这个结论,因为gem文件存储在不同的位置: RVM gemset:〜/ ~/.rvm/gems/ruby-2.0.0-p247@myApp Bundler: [my_app_dir]/vendor/bundle/gems 所以应用程序使用Bundlergem,而不是RVM gemsetgem。 但是当我向我的Gemfile添加gem时,RubyMine IDE向我显示警告,这个gem不在RVM gemset中。 所以我也将这个gem添加到RVM gemset(只是为了摆脱这个警告)。 所以问题是: 有没有什么好的理由在两个地方添加gem(RVM Gemset和Gemfile)? 如果没有,那么为什么RubyMine警告我这个?

如何获取Linkedin用户数据?

我正在使用Linkedin API来获取RoR项目中的用户内容。 我正在关注这个博客。 这是控制器代码: 基本档案(工作正常) client = get_client profile = client.profile(:fields => [“first-name”, “last-name”, “maiden-name”, “formatted-name” ,:headline, :location, :industry, :summary, :specialties, “picture-url”, “public-profile-url”]) 经验和职位: client = get_client positions = client.profile(:fields => [:positions]).positions.all 对于教育: client = get_client educations = client.profile(:fields => [:educations]).educations.all 而get_client def get_client linkedin_oauth_setting = LinkedinOauthSetting.find_by_user_id(current_user.id) client = LinkedIn::Client.new(‘aaadad’, ‘dadada’, @@config) client.authorize_from_access(linkedin_oauth_setting.atoken, linkedin_oauth_setting.asecret) client […]