Skip to content

Commit

Permalink
update ruby using Chef
Browse files Browse the repository at this point in the history
  • Loading branch information
Dangeranger committed Mar 2, 2015
1 parent 1b92873 commit 45324bf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -25,7 +25,7 @@ Vagrant::Config.run do |config|

# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
config.vm.forward_port 80, defined?(HTTP_PORT) ? HTTP_PORT : 8080
config.vm.forward_port 80, defined?(HTTP_PORT) ? HTTP_PORT : 8888
config.vm.forward_port 3000, defined?(RAILS_PORT) ? RAILS_PORT : 8000

# Share an additional folder to the guest VM. The first argument is
Expand Down
52 changes: 26 additions & 26 deletions db/schema.rb
Expand Up @@ -20,8 +20,8 @@
t.string "access_token"
t.string "access_token_secret"
t.text "info"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "companies", :force => true do |t|
Expand All @@ -30,8 +30,8 @@
t.string "twitter"
t.text "address"
t.text "description"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "logo_url"
t.string "logo_file_name"
t.string "logo_content_type"
Expand All @@ -46,16 +46,16 @@
create_table "company_projects", :force => true do |t|
t.integer "company_id"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "employments", :force => true do |t|
t.integer "person_id"
t.integer "company_id"
t.string "title"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "friendly_id_slugs", :force => true do |t|
Expand All @@ -73,15 +73,15 @@
t.integer "group_id"
t.integer "person_id"
t.string "membership_type"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "group_projects", :force => true do |t|
t.integer "group_id"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "groups", :force => true do |t|
Expand All @@ -91,8 +91,8 @@
t.string "mailing_list"
t.string "twitter"
t.text "meeting_info"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "logo_url"
t.string "logo_file_name"
t.string "logo_content_type"
Expand All @@ -109,8 +109,8 @@
t.string "twitter"
t.string "url"
t.text "bio"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "user_id"
t.string "name"
t.string "imported_from_provider"
Expand All @@ -135,17 +135,17 @@
create_table "project_memberships", :force => true do |t|
t.integer "person_id"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "projects", :force => true do |t|
t.string "name"
t.string "url"
t.string "twitter"
t.text "description"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "logo_file_name"
t.string "logo_content_type"
t.integer "logo_file_size"
Expand All @@ -161,17 +161,17 @@
t.string "url"
t.text "description"
t.string "category"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "delta", :default => true, :null => false
end

create_table "sponsorships", :force => true do |t|
t.integer "group_id"
t.integer "company_id"
t.string "sponsorship_type"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "taggings", :force => true do |t|
Expand Down Expand Up @@ -199,8 +199,8 @@
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "admin", :default => false
t.string "email"
end
Expand Down
26 changes: 26 additions & 0 deletions vagrant/cookbooks/vagrant/recipes/default.rb
@@ -1,5 +1,6 @@
APPDIR = "/vagrant" # Application directory
USER = "vagrant" # User that owns files
TEMP_DIR = "/usr/local/src"

# Change directory to /vagrant after doing a `vagrant ssh`.
execute "update-profile-chdir" do
Expand All @@ -17,6 +18,31 @@
end
end

# Install a modern Ruby version
execute "Create Temp Dir" do
command "mkdir -p #{TEMP_DIR}"
end

execute "Get ruby source"do
cwd TEMP_DIR
command "wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz"
end

execute "Extract Ruby Source" do
cwd TEMP_DIR
command "tar -xvzf ruby-2.1.2.tar.gz && rm ruby-2.1.2.tar.gz"
end

execute "Configure ruby for build" do
cwd "#{TEMP_DIR}/ruby-2.1.2"
command "./configure --prefix=/opt/vagrant_ruby"
end

execute "Make and Install Ruby" do
cwd "#{TEMP_DIR}/ruby-2.1.2"
command "make && sudo make install"
end

# Remove obsolete file
file "/etc/profile.d/rubygems1.8.sh" do
action :delete
Expand Down

0 comments on commit 45324bf

Please sign in to comment.